Skip to content
This repository has been archived by the owner on Jun 25, 2020. It is now read-only.

fix: fixing tooltip for expanded area chart #134

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ function nvd3Vis(element, props) {
chart.interactiveLayer.tooltip.contentGenerator(d =>
generateRichLineTooltipContent(d, smartDateVerboseFormatter, yAxisFormatter),
);
} else {
} else if (areaStackedStyle !== 'expand') {
// area chart
chart.interactiveLayer.tooltip.contentGenerator(d =>
generateAreaChartTooltipContent(d, smartDateVerboseFormatter, yAxisFormatter),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,42 @@ export default [
storyName: 'Stacked',
storyPath: 'legacy-|preset-chart-nvd3|AreaChartPlugin',
},
{
renderStory: () => (
<SuperChart
chartType="area"
chartProps={{
datasource: {
verboseMap: {},
},
formData: {
bottomMargin: 'auto',
colorCcheme: 'd3Category10',
contribution: false,
groupby: ['region'],
lineInterpolation: 'linear',
metrics: ['sum__SP_POP_TOTL'],
richTooltip: true,
showBrush: 'auto',
showControls: false,
showLegend: true,
stackedStyle: 'expand',
vizType: 'area',
xAxisFormat: '%Y',
xAxisLabel: '',
xAxisShowminmax: false,
xTicksLayout: 'auto',
yAxisBounds: [null, null],
yAxisFormat: '.3s',
yLogScale: false,
},
height: 400,
payload: { data },
width: 400,
}}
/>
),
storyName: 'Expanded',
storyPath: 'legacy-|preset-chart-nvd3|AreaChartPlugin',
},
];