-
Notifications
You must be signed in to change notification settings - Fork 2.9k
[Fix]: Markers are too big in LineChart and ScatterChart #35699
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
base: master
Are you sure you want to change the base?
Conversation
📊 Bundle size reportUnchanged fixtures
|
|
Pull request demo site: URL |
packages/charts/react-charts/library/src/components/LineChart/LineChart.tsx
Show resolved
Hide resolved
packages/charts/react-charts/library/src/components/LineChart/LineChart.tsx
Outdated
Show resolved
Hide resolved
…yushsingla/marker-bug
…ushsingla/marker-bug
|
@singlayush please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|

Fix marker sizing in LineChart and ScatterChart
Problem
Markers in LineChart and ScatterChart were rendering too large compared to expected behavior (e.g., Plotly). The previous formula
(markerSize * extraMaxPixels) / maxMarkerSizewould essentially result in scaling markers based on the extraMaxPixels. But we would only want to scale down and not scale up. The scaling down is needed to ensure there is no overflow out of the chart, while scaling up serves no purpose and results in too big markers.Solution
Updated the marker radius calculation to use conditional logic:
Logic:
extraMaxPixels > maxMarkerSize: Use the actualmarkerSizedirectly (enough space available)Examples
Changes
Screenshots
Before
Before
Plotly
Before
Testing