JohnnyD
JohnnyD

Reputation: 477

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?

Upvotes: 2

Views: 2871

Answers (1)

Mark
Mark

Reputation: 108512

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

enter image description here

Upvotes: 4

Related Questions