I have a couple of lines I want to draw in a chart with Chart.js. The data looks something like this:
Line 1:
- x: 12.03.2021, 30.03.2021, 04.04.2021
- y: 10, 20, 30
Line 2:
- x: 03.02.2021, 10.05.2021, 05.06.2021, 07.06.2021
- y: 40, 50, 30, 5
... many more lines
The problem is: The lines have different timestamps and also different amount of ticks (line 1 has 3 ticks/timestamps, line 2 has 4).
How can I consolidate this into a time line chart automatically? I already tried this option, but it doesn't seem to work:
options: {
scales: {
x: {
type: 'time',
time: {
// Luxon format string
tooltipFormat: 'DD T'
},
title: {
display: true,
text: 'Date'
}
},
Via Active questions tagged javascript - Stack Overflow https://ift.tt/2FdjaAW
Comments
Post a Comment