-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
breaking changeIntroduces changes that are not backward compatible.Introduces changes that are not backward compatible.designThis is about UI or UX design, please involve a designer.This is about UI or UX design, please involve a designer.needs benchmarkingNeeds to look at different options.Needs to look at different options.scope: chartsChanges related to the charts.Changes related to the charts.type: enhancementIt’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.v9.x
Description
Summary
The default margin values in:
mui-x/packages/x-charts/src/constants/index.ts
Lines 5 to 10 in ecc9177
export const DEFAULT_MARGINS = { | |
top: 20, | |
bottom: 20, | |
left: 20, | |
right: 20, | |
}; |
feel way too opinionated. I would expect almost 0. Or at the very least, to have them managed with CSS.
Examples
By order of margin present, sorted asc:
- https://www.chartjs.org/docs/latest/samples/bar/border-radius.html almost no margin by default
- https://recharts.org/en-US/examples/DashedLineChart has some margin by default, definitely not as much as we have. But it also feels a bit too much.
- https://www.highcharts.com/demo/highcharts/bubble has some margin by default, definitely not as much as we have. But it also feels too much.
Motivation
- CSS is a more powerful tool to manage margins, e.g., media queries.
- CSS is a more commonly known API to manage margins, e.g., Tailwind CSS utility classes.
- CSS has better debugging capabilities by the browser, at least we have https://mui.com/x/react-charts/styling/#placement, but otherwise, good luck. Without margin, people would still need to figure this one out Question: BarChart left margin recharts/recharts#843 (comment) but it's already simpler.
Search keywords: -
bernardobelchior, alexfauquette and oliviertassinari
Metadata
Metadata
Assignees
Labels
breaking changeIntroduces changes that are not backward compatible.Introduces changes that are not backward compatible.designThis is about UI or UX design, please involve a designer.This is about UI or UX design, please involve a designer.needs benchmarkingNeeds to look at different options.Needs to look at different options.scope: chartsChanges related to the charts.Changes related to the charts.type: enhancementIt’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.v9.x