Chartjs-Chart.js how set equal step size depending on actual data (xaxis)?

1👍

Instead of using line chart, use a ‘scatter’ chart. Then omit data.labels and define the data in point format as follows.

data: [
  { x: 1, y: 10 },
  { x: 2, y: 2 },
  { x: 3, y: 5 },
  { x: 5, y: 22 },
  { x: 10, y: 17 },
  { x: 15, y: 11 },
  { x: 17, y: 3 }
],

Please have a look at your amended JSFiddle.

Leave a comment