Skip to content
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

[@mantine/charts] BarChart: added waterfall type #6231

Merged
merged 3 commits into from
May 24, 2024

Conversation

Maetes
Copy link
Contributor

@Maetes Maetes commented May 13, 2024

This is related to #6224

Enhancement to ChartTooltip.tsx: Support for number[] in valueFormatter

This pull request introduces support for an array of numbers (number[]) as input to the valueFormatter property in ChartTooltip.tsx. Previously, valueFormatter was strictly typed as (value: number) => string. However, the Recharts documentation indicates that both bar and area charts may utilize an array of numbers as input (see: AreaChart API and BarChart API).

Modifying the valueFormatter type globally would impact other charts adversely. Therefore, I have refrained from altering the type but have extended the functionality in ChartTooltip.tsx to accommodate a tuple of two numbers, which is essential for the waterfall chart implementation. This update ensures compatibility without affecting existing chart functionalities.

Enhancement to ChartLegend.tsx

Accepts now a showColor prop to turn on and of the ColorSwatch (true) by default

Review questions
Please check that the special keys color and standalone are semantically okay for you to use as a data input.

color: beside of the series adds the functionality to change the color of a single Bar.
standalone: Only used for waterfall if you want to render a Bar which does not depend on the previous one.

@rtivital rtivital merged commit 8bdabaf into mantinedev:master May 24, 2024
@rtivital
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants