Search code examples
jqplot

jqPlot DateAxisRenderer Strange Behaviour


I have a fairly straightforward graph with a date axis. All the date data is in unix timestamp format.

When I render the graph without the DateAxisRenderer the graph appears as it should do...

As expected:
(source: 193.169.90.16)

...but when I add in the DateAxisRenderer...

Not as expected
(source: 193.169.90.16)

... the data points appear jumbled.

The only difference between these two graphs is the addition of the following lines...

renderer: $.jqplot.DateAxisRenderer,
rendererOptions: { tickRenderer: $.jqplot.CanvasAxisTickRenderer },
tickInterval: '7 day',
tickOptions: { formatString: '%d %b' }

The whole thing is live here.

Is this is a bug or am I missing something trivial?


Solution

  • The DateAxisRenderer is choking on all the nulls in your input Array. If you take out those points it behaves:

    enter image description here