Skip to content

[charts] Make line series type support radial and cartesian#22050

Open
alexfauquette wants to merge 6 commits intomui:masterfrom
alexfauquette:cartesian-and-polar
Open

[charts] Make line series type support radial and cartesian#22050
alexfauquette wants to merge 6 commits intomui:masterfrom
alexfauquette:cartesian-and-polar

Conversation

@alexfauquette
Copy link
Copy Markdown
Member

@alexfauquette alexfauquette commented Apr 10, 2026

Extracted from #21968

In this PR the series config can now be axisType: 'cartesian' | 'polar'; to indicate the series support both

Having different series type for cartesian and polar series makes it tricky because they have the same seriesType ('line') but one has some xAxis, whereas the other has a rotationAxis.

In this PR I propose to add an extra AxisType generic argument to distinguish when necessary the cartesian / radial

Other options

  • Add a coordinateSystem?: 'cartesian' | 'radial' to the series type with the default set to cartesian.

    • pros: cartesian specific code can easily skip those with coordinateSystem === 'radial' and then get the correct type.
    • cons: Users will need to specify this when using composition. Or we might be able to set the correct default value based on the available plugins.
  • Keep only one series type. For the axes id, we could use xAxisId, yAxisId for the rotation/radius axes. Or assume radial lines have only one axis, so radial plot just ignore those.

    • pros: little or no modification
    • cons: properties that are specific to a given coordinate type might leak in the other one
  • Introduce a new series type radialLine that copies most of the line series.

    • pros: straightforward with clear distinction
    • cons: does not communicate the fact that it's exactly the same concept as the line chart but in a radial coordinate system

@alexfauquette alexfauquette added typescript type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. scope: charts Changes related to the charts. labels Apr 10, 2026
@mui-bot
Copy link
Copy Markdown

mui-bot commented Apr 10, 2026

Deploy preview: https://deploy-preview-22050--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 🔺+50B(+0.01%) 🔺+17B(+0.02%)
@mui/x-charts-pro 🔺+50B(+0.01%) 🔺+17B(+0.01%)
@mui/x-charts-premium 🔺+50B(+0.01%) 🔺+17B(+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 0b561c0

@alexfauquette alexfauquette changed the title [charts] Make line and bar series type be radial and cartesian [charts] Make line series type support radial and cartesian Apr 10, 2026
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Apr 10, 2026

Merging this PR will not alter performance

✅ 14 untouched benchmarks


Comparing alexfauquette:cartesian-and-polar (0b561c0) with master (af147ca)

Open in CodSpeed

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

Labels

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. typescript

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants