score:0

Accepted answer

you should change the options for to xaxes of your chart.

const chart = new chart(ctx, {
type: 'line',
data: data,
options: {
    scales: {
        xaxes: [{
            ticks: {
                callback: function(value, index, values) {
                    return math.round(value).tostring();
                }
            }
        }]
    },
    tooltips: {
        callbacks: {
            title: function(tooltipitem, data) {
               return data.labels[tooltipitem[0].index];
          }
       }
   }
}});

i think that this won't change the dataset.


Related Query

More Query from same tag