I’m using jqPlot (version 1.0.2, I believe — the 7/25/12 release) to render a day’s worth of solar energy production for a variety of values. When I zoom into a portion of the day, quite often the wrong area of the chart is rendered.
Here are the plot options —
var plotOptions = {
series: [{ showMarker:false} ],
axes: {
xaxis:{
renderer:jQuery.jqplot.DateAxisRenderer,
tickOptions:{
formatString:'%R'
},
min: data[0].time * 1000,
max: data[data.length - 1].time * 1000
},
yaxis: {
tickOptions: {
formatString: '%.3f'
}
}
},
highlighter: {
show : true,
sizeAdjust: 7.5
},
cursor: {
show : true,
zoom: true,
showToolTip: false
}
};
The data are 1 minute samples of the entire electrical system, with the current default value being the AC current on one phase leg (standard North American electrical system — 120/240 volt AC power). There are typically 1,440 samples, one for each minute of the day.
What I see happen is I’ll select a region, typically 4 or 6 hours, and the wrong part of the data is being zoomed. For example, if I select midnight to 8am, I’ll see 4am to 8am (or perhaps 9am, if I zoom a little past 8am) zoomed instead. This is fairly consistent — the second half of the range being displayed — but I also see instances where there’s no rhyme or reason to what shows up, and the values may be zoomed in so close I can’t tell what’s what.
I’ve tried to steal heavily from the examples, but to no avail. I’ve also tried limiting the size of my data set and that doesn’t much seem to help.
UPDATE: I tried switching from using raw timestamps to using Date() objects, to no avail …
I ran in to this same issue. I couldn’t switch to Flot, although it is a good package also. I did some digging and found this post on the jqplot-users google group that had the answer.
Here’s the short answer. There is a bug in src\plugins\jqplot.dateAxisRenderer.js. The post says the work around is to commment out the following in the dataAxisRenderer.js file
HOWEVER, I’m not sure if
is necessary or not, removing this might be a bad idea. I haven’t noticed anything off but, I think we could keep those lines and just remove
min.getUtcOffset().