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'
}
}
}
- Chartjs-Is it possible to setup vue-chartjs 3.5.1 with momentjs for formatting dates in chart.js
- Chartjs-How to group chart labels together?
Source:stackexchange.com