Replies: 1 comment
-
|
@resthedev Did you resolve your problem? I want to do the exact same thing |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am using the ChartJS library via react-chartjs-2.
For my charts, I am using the Time Cartesian Axis alongside the date-fns adapter.
I am having an issue when rendering only a single data point on my line chart / bar chart / scatter chart. It currently renders like this.
It seems that since there is only one data point (and no other points to reference), it displaying the timestamps in the x scale like:
And also nothing is drawn on my line chart when there is only a single point, since I am using a point radius of 0 and they are only shown on hover.
How can I handle these single data point cases so that
I was thinking I would have to override chart options like line chart point radius,
sourcefield inticksoption, etc. to configure the options for the special case of a single data point maybe?Or are there better, cleaner ways to handle this?
Beta Was this translation helpful? Give feedback.
All reactions