Chartjs-Chart.js: How to display object data types on line graph correctly?

0👍

To achieve this I had to skip the labels I didn’t want to show, but they had to be on the graph, even though not visible. Here is the code for the Y axis:

options: {
        scales: {
          yAxes: [{
            scaleLabel: {
                display: true,
                labelString: 'Users'
            },
            gridLines: {
              drawTicks: false
            },
            ticks: {
              min: 400,
              max: 1100,
              stepSize: 50,
              skipRatio: 2,
              callback: function(tick, index, array){
                return (index % 2) ? "" : tick;
              },
              padding: 5
            }
          }]
        }
      }

I did the same for the X axis and managed to get an identical graph to the one on the image.

Leave a comment