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

Commit

Permalink
fix: fixing tooltip for expanded area chart
Browse files Browse the repository at this point in the history
  • Loading branch information
Michelle Thomas committed Jul 2, 2019
1 parent 3404dee commit cb651fa
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
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',
},
];

0 comments on commit cb651fa

Please sign in to comment.