-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[@mantine/charts] BarChart: Add waterfall type (#6231)
* [@mantine/charts] BarChart: added waterfall type * Code review and fixes * Update demo code --------- Co-authored-by: Vitaly Rtishchev <rtivital@gmail.com>
- Loading branch information
Showing
12 changed files
with
168 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
packages/@docs/demos/src/demos/charts/BarChart/BarChart.demo.waterfall.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { BarChart } from '@mantine/charts'; | ||
import { MantineDemo } from '@mantinex/demo'; | ||
import { waterfallCode, waterfallData } from './_data'; | ||
|
||
const code = ` | ||
import { BarChart } from '@mantine/charts'; | ||
import { data } from './data'; | ||
function Demo() { | ||
return ( | ||
<BarChart | ||
h={300} | ||
data={data} | ||
dataKey="item" | ||
type="waterfall" | ||
series={[{ name: 'Effective tax rate in %', color: 'blue' }]} | ||
withLegend | ||
/> | ||
); | ||
} | ||
`; | ||
|
||
function Demo() { | ||
return ( | ||
<BarChart | ||
h={300} | ||
data={waterfallData} | ||
dataKey="item" | ||
type="waterfall" | ||
series={[{ name: 'Effective tax rate in %', color: 'blue' }]} | ||
withLegend | ||
/> | ||
); | ||
} | ||
|
||
export const waterfall: MantineDemo = { | ||
type: 'code', | ||
component: Demo, | ||
code: [ | ||
{ code, language: 'tsx', fileName: 'Demo.tsx' }, | ||
{ code: waterfallCode, language: 'tsx', fileName: 'data.ts' }, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters