In my code, I want to set y-axis ‘0’ when i didn’t put the value in var line1.
Now I didn’t put information about [‘2013-01-25 11:23am’].
In this case, I want to set y-asix value to 0. No, it didn’t work like that.
How can I do?
function Drawchart() {
this.showChart = function() {
$(document).ready(
function() {
var line1 = [ [ '2013-01-25 11:20am', 20 ],
[ '2013-01-25 11:35AM', 30 ],
[ '2013-01-25 11:36AM', 7 ],
[ '2013-01-25 11:37AM', 3 ],
[ '2013-01-25 11:38AM', 1 ],
[ '2013-01-25 11:39AM', 2 ] ];
var plot2 = $.jqplot('chart', [ line1 ], {
title : 'Customized Date Axis',
gridPadding : {
right : 35
},
axes : {
xaxis : {
renderer : $.jqplot.DateAxisRenderer,
pad : 0,
tickOptions : {
angle : -90,
fontSize : "5pt",
formatString : '%I:%M%p '
},
min : '11:00 AM',
tickInterval : '1 minute'
},
yaxis : {
min : 0
}
},
series : [ {
lineWidth : 4,
color : '#000000',
markerOptions : {
style : 'square'
}
} ]
});
});
}
}
You can’t because JQPlot need to know which points must be drawn in the serie.
You need to set your
0points manualy like this :['2013-01-25 11:23am',0]and include them into the array.