Chartjs-Generating ticks for a large dataset truncates the ticks array, even when most ticks are null

0👍

Here is a codepen https://codepen.io/stockinail/pen/PoaNjbp where 3000 items are added using the time scale. Hopefully I have understood well your use case.
Be aware the sample is using CHART.JS 3.
Using the ticks.source: 'label', I can force CHARTJS to use the labels which are passed in the scale (pay attention to the parser option as well, needed to parse the labels of the ticks).

scales: {
 x: {
    type: 'time',
    labels: ['Sep 22', 'Oct 22', 'Nov 22', 'Dec 22'],
    ticks: {
      source: 'labels'
    },
    time: {
        unit: 'month',
        displayFormats: {
          month: 'MMM yy'
        },
        parser: 'MMM yy'
    }
 }
}

Leave a comment