[Chartjs]-Vuejs – Chart.js wrapper vue3-chart-v2 not displaying labels when data are passed as object

1👍

This is because you provide the X values as numbers while the default implementation of the X scale for a line chart is category, the category scale expects strings for its values.

So you can solve your problem in 2 ways, either change your X values from numbers to strings or change your X scale type to linear.

chartOptions: {
  parsing: false,
  scales:{
    x:{
      type: 'linear'
    }
  }
}

Leave a comment