In Chart, Setting minimum chart height when data values are all zero #1342
Unanswered
joffreypersia
asked this question in
Feature Requests
Replies: 1 comment 3 replies
-
@joffreypersia Have you tried determining the dataset's max y, before rendering the chart, and if it's zero, explicitly setting the |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I have a chart that displays visits to my app. The problem is that when a user has no visits during a time range, the chart height becomes null.
I'd like to set a minimum height for the chart even when there's no data - specifically showing a y-axis that goes from 0 to 1, while keeping the line at 0.
I've found these two possible solutions in Chart.js:
vs
In ChartJS there is :
Or using the grace parameter combined with min:
Has anyone implemented something like this? Which approach would be better for ensuring the chart always shows at least some height (0 to 1 range) even with zero values?
Thank you
Beta Was this translation helpful? Give feedback.
All reactions