This is the data that I have (array of 2 objects represented by 2 graphs)
[{"label":"Estimated Profit","color":"#4572A7","lines":{"show":true,"lineWidth":4},"points":{"show":true,"radius":4},"data":[[1443628800000,"29.00"],[1441036800000,"33.55"],[1438358400000,"32.55"],[1435680000000,"32.37"],[1433088000000,"35.12"],[1430409600000,"29.74"],[1427817600000,"36.00"],[1425139200000,"33.93"],[1422720000000,"31.37"],[1420041600000,"30.13"],[1417363200000,"31.09"],[1414771200000,"30.51"]]},{"label":"Actual Profit","color":"#AA4643","lines":{"show":true,"lineWidth":4},"points":{"show":true,"radius":4},"data":[[1443628800000,"29.00"],[1441036800000,"33.55"],[1438358400000,"32.55"],[1435680000000,"32.37"],[1433088000000,"35.12"],[1430409600000,"29.74"],[1427817600000,"36.00"],[1425139200000,"33.93"],[1422720000000,"31.37"],[1420041600000,"30.13"],[1417363200000,"31.09"],[1414771200000,"30.51"]]}]
And the very ordinary Flot's plot
function call
$.plot($("#Profits"), profit_data, {
lines: {
show: true
},
legend: {
show: true
},
points: {
show: true
},
grid: {
show: true,
hoverable: true,
clickable: false,
borderColor: '#cccccc'
},
xaxis: {
min: (new Date(data.min)).getTime(),
max: (new Date(data.max)).getTime(),
mode: "time",
timeformat: "%b",
tickSize: [1, "month"],
monthNames: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
tickLength: 0, // hide gridlines
axisLabel: 'Month',
axisLabelUseCanvas: true,
axisLabelFontSizePixels: 12,
axisLabelFontFamily: 'Verdana, Arial, Helvetica, Tahoma, sans-serif',
axisLabelPadding: 5
},
yaxis: {
axisLabel: 'Profits (%)',
axisLabelUseCanvas: true,
axisLabelFontSizePixels: 12,
axisLabelFontFamily: 'Verdana, Arial, Helvetica, Tahoma, sans-serif',
axisLabelPadding: 5
}
});
But for some reason it only plots 1 graph out, even though the legend box shows there are 2 graphs. See photo:
What am I missing here?
Both the data points are same.
[[1443628800000,"29.00"],[1441036800000,"33.55"],[1438358400000,"32.55"],[1435680000000,"32.37"],[1433088000000,"35.12"],[1430409600000,"29.74"],[1427817600000,"36.00"],[1425139200000,"33.93"],[1422720000000,"31.37"],[1420041600000,"30.13"],[1417363200000,"31.09"],[1414771200000,"30.51"]]
[[1443628800000,"29.00"],[1441036800000,"33.55"],[1438358400000,"32.55"],[1435680000000,"32.37"],[1433088000000,"35.12"],[1430409600000,"29.74"],[1427817600000,"36.00"],[1425139200000,"33.93"],[1422720000000,"31.37"],[1420041600000,"30.13"],[1417363200000,"31.09"],[1414771200000,"30.51"]]
Estimated Profit line is being overlapped by Actual Profit and so it is not visible. Check the data you are generating.