Skip to content

Conversation

@bernardobelchior
Copy link
Member

@bernardobelchior bernardobelchior commented Oct 24, 2025

Handle undefined id and color in series.

Previously, a pattern like the following would result in an undefined fill property if condition is false:

series: [{
  color: condition ? '#ab12ef' : undefined,
}]

Now, it will use the default color. The same logic applies to the id property.

To work around that behavior, a user would need to do this, which is worse DX IMO:

series: [{
  ...(condition ? { color: '#ab12ef' } : {}),
}]

Results

Before:

Screen.Recording.2025-10-24.at.16.16.55.mov

After:

Screen.Recording.2025-10-24.at.16.17.27.mov

@bernardobelchior bernardobelchior added type: bug It doesn't behave as expected. scope: charts Changes related to the charts. labels Oct 24, 2025
@mui-bot
Copy link

mui-bot commented Oct 24, 2025

Deploy preview: https://deploy-preview-20087--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 🔺+61B(+0.02%) 🔺+17B(+0.02%)
@mui/x-charts-pro 🔺+76B(+0.02%) 🔺+31B(+0.02%)
@mui/x-charts-premium 🔺+76B(+0.02%) 🔺+27B(+0.02%)
@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 8d5c7ca

@bernardobelchior bernardobelchior enabled auto-merge (squash) October 24, 2025 15:29
@codspeed-hq
Copy link

codspeed-hq bot commented Oct 24, 2025

CodSpeed Performance Report

Merging #20087 will not alter performance

Comparing bernardobelchior:fix-null-id-color (8d5c7ca) with master (e8522b1)1

Summary

✅ 12 untouched
🆕 1 new

Benchmarks breakdown

Mode Benchmark BASE HEAD Change
🆕 Simulation SankeyChart with big data amount N/A 134.4 ms N/A

Footnotes

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

@bernardobelchior bernardobelchior merged commit e21f010 into mui:master Oct 24, 2025
25 checks passed
@bernardobelchior bernardobelchior deleted the fix-null-id-color branch October 24, 2025 15:50
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: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants