bomortensen
bomortensen

Reputation: 3396

Single point is buggy in flot.js chart

I'm having a bit of trouble trying to implement a flot chart correctly. It's a line chart with dates on the X axis and decimal values on the Y axis.

The chart displays fine, but there's a single point which is, essentially, at the correct place on the graph, but then spans all the way through it.

See screenshot for reference: enter image description here

I have checked that the date value of the point is correct (it's 30/9/2015 (EU date format) and the next is 1/10/2015 (EU date format)) The decimal number is also correctly placed, it seems.

The JSON that I'm using is this: gist

The JSON data comres from an ASP.NET webserver.

Does anyone know what I'm doing wrong here? :-)

Thanks in advance.

Upvotes: 0

Views: 72

Answers (1)

mechenbier
mechenbier

Reputation: 3067

The timestamp of the last record in your gist is the smallest timestamp, which means it should be the first record to plot properly. Flot plots data in the order that data is fed to it -- you should sort it before you feed it to Flot for plotting.

Upvotes: 3

Related Questions