Skip to content

[charts] Use dedicated shape for line charts without showMark#21725

Open
alexfauquette wants to merge 3 commits intomui:masterfrom
alexfauquette:refine-shapes
Open

[charts] Use dedicated shape for line charts without showMark#21725
alexfauquette wants to merge 3 commits intomui:masterfrom
alexfauquette:refine-shapes

Conversation

@alexfauquette
Copy link
Member

Follow up on #21713

When using axis highlight with a line chart that does not have marks, it feels weird to see large shape for each series

  • The fact that each series has a dedicated shape is useless because it does not relate to the tooltip/legend
  • The fact the shapes are that big is to fully cover the default marks. When we know that marks are not render, we can reduce a bit the size of the highlight

@alexfauquette alexfauquette added breaking change Introduces changes that are not backward compatible. scope: charts Changes related to the charts. design: ui Visual design. labels Mar 12, 2026
@mui-bot
Copy link

mui-bot commented Mar 12, 2026

Deploy preview: https://deploy-preview-21725--material-ui-x.netlify.app/

Bundle size report

Bundle Parsed size Gzip size
@mui/x-data-grid 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-pro 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-premium 0B(0.00%) 0B(0.00%)
@mui/x-charts 🔺+27B(+0.01%) 🔺+10B(+0.01%)
@mui/x-charts-pro 🔺+27B(+0.01%) 🔺+13B(+0.01%)
@mui/x-charts-premium 🔺+27B(+0.01%) 🔺+11B(+0.01%)
@mui/x-date-pickers 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers-pro 0B(0.00%) 0B(0.00%)
@mui/x-tree-view 0B(0.00%) 0B(0.00%)
@mui/x-tree-view-pro 0B(0.00%) 0B(0.00%)

Details of bundle changes

Generated by 🚫 dangerJS against 7fabcc0

@JCQuintas
Copy link
Member

When using axis highlight with a line chart that does not have marks, it feels weird to see large shape for each series

Why though? Like, if the series you are looking at has no marks, you would want to have any way to relate which line is which. You can try to follow the lines, but it could be ambiguous in some points

@codspeed-hq
Copy link

codspeed-hq bot commented Mar 12, 2026

Merging this PR will improve performance by 8.14%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 1 improved benchmark
✅ 13 untouched benchmarks

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation ScatterChartPro with big data amount (single renderer) 476 ms 440.1 ms +8.14%

Comparing alexfauquette:refine-shapes (7fabcc0) with master (1fdb8c3)1

Open in CodSpeed

Footnotes

  1. No successful run was found on master (a48f8ee) during the generation of this report, so 1fdb8c3 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@alexfauquette alexfauquette added the type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. label Mar 12, 2026
@alexfauquette
Copy link
Member Author

Why though? Like, if the series you are looking at has no marks, you would want to have any way to relate which line is which. You can try to follow the lines, but it could be ambiguous in some points

@JCQuintas I don't get if you're talking about the first point (different shapes) or the second (shapes are too large)

you would want to have any way to relate which line is which

  • about shape
    • If you're color blind, the mark does not help, because they do not appear in the legend,
    • If you're not color blind, you already have the colors
  • about size it's just a design aspect about how much you want to emphasis the point

Before/After

image image

Related topic

Showing only one mark per series at the end

#21645

@JCQuintas
Copy link
Member

Ok, regarding the shape yes, they don't need to be large.

My point is more that it should probably use different shapes though.

@alexfauquette
Copy link
Member Author

My point is more that it should probably use different shapes though.

To me it looks off. When I see different shapes, my first reaction is "Ok, this cross probably mean something". And then there is not extra info about it. Whereas circle has the advantage to be "neutral"

@JCQuintas
Copy link
Member

To me it looks off.

Could be. I don't think it is necessary, more of a nice to have.

It should at least respect the shape value though. So users can define the shape if they want to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Introduces changes that are not backward compatible. design: ui Visual design. scope: charts Changes related to the charts. type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants