-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[charts] Axis not plot if the domain contains only one value #13973
Comments
I am not 100% sure whether there is a certain config to enable this. But from looking at the doc, it seems like a bug to me. Please let me know if there is a easy hack to get around this and I will close the issue. Thanks. |
This solves your issue yAxis={[{ min: -2, max: 1 }]} But effectively it's weird. We should have a deeper look at it to know where it fails. I guess it's something like "The domain is [-1, -1], then it's empty, noting to display" |
Seems we have room for improvement. The reason why no axis is displayed, if this kind of condition
They got added (in x axis, y axis and useTicks) when we added support for the "no data" overlay The root cause is that the axis provider correctly compute that there is no data to display. It returns extremums mui-x/packages/x-charts/src/context/CartesianProvider/computeValue.ts Lines 171 to 180 in 0fb15c6
To spot that we use The best fix might be to add a property to the axis object |
Fixed in #14191 |
@Ashiq5: How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey. |
Steps to reproduce
Link to live example: (required)
Steps:
After the dependencies are installed, you should see a line chart with no Y-axis label and ticks.
Current behavior
Missing Y-axis labels and ticks when all the values in a data are equal.
Expected behavior
Y-axis labels and ticks should appear irrespective of data values.
Context
Display Y-axis label and ticks irrespective of the data values.
Your environment
Browser: Google Chrome
Search keywords: Y axis ticks and labels missing
The text was updated successfully, but these errors were encountered: