[Chartjs]-Chart.js only showing two datapoints in the middle of the data

1👍

It looks like there are inconsistencies in the data you’re passing. Some of the lap_ave’s are "#.##" while others are "#:#.##"

If you change the last value in the fiddle below to "1.03", you’ll see the third data point show up on the graph.

var dates = ["01/12/23", "01/13/23", "01/16/23"];
var lap_ave = ["1.01", "1.04", "01:03.1000"]; 

https://jsfiddle.net/q0a23j4z/

1👍

You provide strings for your data array. Chart.js expects numbers for the y axis. You can fix this by setting your y axis to a category scale and provide a labels array with a valid lap times.

But the easyest solution would be for you to transform the minute:seconds format to only seconds and use that in combination with a custom tick callback

Leave a comment