-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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] How to avoid component overflow when using composition #12506
Comments
The min/max properties of the y axis should do the job
|
Sorry, I didn't realize how easy it was to make a repro from the demo's in the docs! 🎉 You'll see that the bars extend above and below the min and the max values. At the very least, I'm looking to adjust the min, so that it is much closer to where our data can show significant changes. So, displaying from 0 does not allow us to see enough change, and setting |
Ho, you're using composition. In that case, you will need to clip the content. We have an helper <g clipPath={`url(#${clipPathId})`}>
/* ... all the element that need to stay in the drawing area ... */
</g>
<ChartsClipPath id={clipPathId} /> Here it your example with the fix: https://stackblitz.com/edit/react-emgvkt-1vja5y?file=Demo.tsx You can refer to the current implementation for more details about what's inside and what's not: https://github.com/mui/mui-x/blob/master/packages/x-charts/src/BarChart/BarChart.tsx
I'm keeping the issue open, to remember we need to document this aspect |
@mckelveygreg: 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. |
The problem in depth
We have a bar graph where the significant portion is too small if the range starts at zero.
We'd like to be able to set the range to -1 of the min, and +1 of the max. Granted, we can calculate those values, but I do not know where to set them?
Your environment
`npx @mui/envinfo`
Search keywords: bar, range, min, non zero
Order ID: 86237
The text was updated successfully, but these errors were encountered: