JQPlot Date range too large even with x-axis max set

时间:2016-07-11 19:44:18

标签: javascript jquery timestamp jqplot

I'm trying to plot this data with JQPlot. The first number is the timestamp.

[[[1452228073000, 5323]], [[1452228073000, 371], [1452832774000, 279]], [[1762228073000, 550], [1463719273000, 494]]]

Here is my plot function:

var chartObj = $.jqplot('chart', dataArray , { title: title, axesDefaults: { tickRenderer: $.jqplot.CanvasAxisTickRenderer, pad: 1.2 }, axes:{ xaxis:{ renderer:$.jqplot.DateAxisRenderer, label:"Time", tickOptions: { formatString:'%Y-%m-%d %H:%M:%S', min: new Date(window.minTime), max: new Date(window.maxTime), angle: 30 }, }, yaxis: { renderer: $.jqplot.LinearAxisRenderer, min: min, label: units } }, cursor:{ show: true, zoom: true }, legend:{ show: true, placement: "outside", labels: dataTypes }, seriesDefaults: { showMarker: false, lineWidth:1, yaxis: 'yaxis' } });

The min and max date bounds are correct for the data given but when I plot the data the X-axis extends way further into the future.

Here is what the graph looks like

My largest date is ~2020 but the graph extends to 2072

0 个答案:

没有答案