-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update chart dimensions to update on chart height resize
- Loading branch information
1 parent
afa1e1b
commit 51f2809
Showing
3 changed files
with
32 additions
and
2 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
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
27 changes: 27 additions & 0 deletions
27
packages/polaris-viz/src/components/LineChart/stories/ResizeableChart.stories.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,27 @@ | ||
export {META as default} from './meta'; | ||
|
||
import {LineChart, LineChartProps} from '../../../components'; | ||
import type {Story} from '@storybook/react'; | ||
import {DEFAULT_DATA, DEFAULT_PROPS} from './data'; | ||
|
||
export const ResizeableChart: Story<LineChartProps> = ( | ||
args: LineChartProps, | ||
) => { | ||
return ( | ||
<div | ||
style={{ | ||
resize: 'both', | ||
overflow: 'hidden', | ||
maxHeight: '100%', | ||
maxWidth: '100%', | ||
}} | ||
> | ||
<LineChart {...args} /> | ||
</div> | ||
); | ||
}; | ||
|
||
ResizeableChart.args = { | ||
...DEFAULT_PROPS, | ||
data: DEFAULT_DATA, | ||
}; |