-
Currently the data scatter point interface is limited to Line 213 in c76ee82 To use in time charts, I would need that x value to be of I think currently it's also not possible to define categorical scatter points (according to docs) with the types but I haven't tested that yet. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
Category points can be defined as number (= label index), but also as string which does not seem to be allowed currently. Edit: date can be a number too = epoch. |
Beta Was this translation helpful? Give feedback.
-
The import { DateTime } from 'luxon';
interface TimeDataPoint {
x: DateTime;
y: number;
};
const timeChart = new Chart<"line", TimeDataPoint>(ctx, {
type: 'line',
data: data,
options: {
scales: {
x: { type: 'time' },
}
}
}); |
Beta Was this translation helpful? Give feedback.
-
yes, thank you that works for me. I was under the impression it has to be of type btw: I haven't found much information about the types in the documentation. Is there like a best practice on how to use them? |
Beta Was this translation helpful? Give feedback.
-
I am facing an issue using DateTime over the xaxis. At all points it is showing dates and when it comes to the chart it shows number. Please check attachments |
Beta Was this translation helpful? Give feedback.
The
Chart
type has a type parameter that lets you override this