This repository has been archived by the owner on Jun 25, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: nvd3 line chart y axis bounds (#17)
* fix: 🐛 y axis bounds * fix: clip edge only when necessary * docs: update storybook * fix: remove src ref from storybook * fix: import order
- Loading branch information
Showing
6 changed files
with
88 additions
and
6 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
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
64 changes: 64 additions & 0 deletions
64
...superset-ui-plugins-demo/storybook/stories/legacy-preset-chart-nvd3/Line/YAxisStories.jsx
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,64 @@ | ||
/* eslint-disable no-magic-numbers */ | ||
import React from 'react'; | ||
import { SuperChart } from '@superset-ui/chart'; | ||
import data from './data'; | ||
|
||
export default [ | ||
{ | ||
renderStory: () => ( | ||
<div className="container"> | ||
<h2>yAxisBounds</h2> | ||
<pre>yAxisBounds=[0, 60000]</pre> | ||
<SuperChart | ||
chartType="line" | ||
chartProps={{ | ||
datasource: { verboseMap: {} }, | ||
formData: { | ||
richTooltip: true, | ||
showLegend: false, | ||
vizType: 'line', | ||
yAxisBounds: [0, 60000], | ||
}, | ||
height: 200, | ||
payload: { data }, | ||
width: 400, | ||
}} | ||
/> | ||
<pre>yAxisBounds=[null, 60000]</pre> | ||
<SuperChart | ||
chartType="line" | ||
chartProps={{ | ||
datasource: { verboseMap: {} }, | ||
formData: { | ||
richTooltip: true, | ||
showLegend: false, | ||
vizType: 'line', | ||
yAxisBounds: [null, 60000], | ||
}, | ||
height: 200, | ||
payload: { data }, | ||
width: 400, | ||
}} | ||
/> | ||
<pre>yAxisBounds=[40000, null]</pre> | ||
<SuperChart | ||
chartType="line" | ||
chartProps={{ | ||
datasource: { verboseMap: {} }, | ||
formData: { | ||
richTooltip: true, | ||
showLegend: false, | ||
vizType: 'line', | ||
yAxisBounds: [40000, null], | ||
}, | ||
height: 200, | ||
payload: { data }, | ||
width: 400, | ||
}} | ||
/> | ||
</div> | ||
), | ||
storyName: 'yAxisBounds', | ||
storyPath: 'legacy-|preset-chart-nvd3|LineChartPlugin', | ||
}, | ||
]; |
3 changes: 2 additions & 1 deletion
3
packages/superset-ui-plugins-demo/storybook/stories/legacy-preset-chart-nvd3/Line/index.js
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 |
---|---|---|
@@ -1,8 +1,9 @@ | ||
import { LineChartPlugin } from '../../../../../superset-ui-legacy-preset-chart-nvd3'; | ||
import Stories from './Stories'; | ||
import YAxisStories from './YAxisStories'; | ||
|
||
new LineChartPlugin().configure({ key: 'line' }).register(); | ||
|
||
export default { | ||
examples: [...Stories], | ||
examples: [...Stories, ...YAxisStories], | ||
}; |