Skip to content

Commit

Permalink
fix: fixing tooltip for expanded area chart (apache#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
michellethomas authored and zhaoyongjie committed Nov 17, 2021
1 parent a0c12cd commit e5a0aec
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 e5a0aec

Please sign in to comment.