score:1

Accepted answer

Chart.js draws your data points in the order they are specified. The drawing of a single data point is not independent from the other data points. Instead, a line is drawn from point to point, in the order specified in the dataset.

An excerpt from your provided dataset shows that the x axis is not in ascending order.

44: {x: Wed May 22 2019 06:50:37 GMT+1000 (Australian Eastern Standard Time), y: "58"}
45: {x: Sun Jun 09 2019 15:43:57 GMT+1000 (Australian Eastern Standard Time), y: "48"}
46: {x: Sun Jun 09 2019 16:44:17 GMT+1000 (Australian Eastern Standard Time), y: "80"}
47: {x: Wed May 22 2019 09:20:12 GMT+1000 (Australian Eastern Standard Time), y: "59"}
48: {x: Mon Jun 10 2019 06:12:26 GMT+1000 (Australian Eastern Standard Time), y: "9"}

To fix this, make sure the data points are ordered before they are passed to Chart.js.


Related Query

More Query from same tag