From 7ca5e6c08546f2784e79e21c7947ddf08572b01e Mon Sep 17 00:00:00 2001 From: michellethomas Date: Fri, 5 Jul 2019 15:31:35 -0700 Subject: [PATCH] fix: fixing tooltip for expanded area chart (#134) --- .../src/NVD3Vis.js | 2 +- .../legacy-preset-chart-nvd3/Area/Stories.jsx | 38 +++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/plugins/superset-ui-plugins/packages/superset-ui-legacy-preset-chart-nvd3/src/NVD3Vis.js b/plugins/superset-ui-plugins/packages/superset-ui-legacy-preset-chart-nvd3/src/NVD3Vis.js index 4f78da8e7c..ad645817c2 100644 --- a/plugins/superset-ui-plugins/packages/superset-ui-legacy-preset-chart-nvd3/src/NVD3Vis.js +++ b/plugins/superset-ui-plugins/packages/superset-ui-legacy-preset-chart-nvd3/src/NVD3Vis.js @@ -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), diff --git a/plugins/superset-ui-plugins/packages/superset-ui-plugins-demo/storybook/stories/legacy-preset-chart-nvd3/Area/Stories.jsx b/plugins/superset-ui-plugins/packages/superset-ui-plugins-demo/storybook/stories/legacy-preset-chart-nvd3/Area/Stories.jsx index 578d5066cf..c9ae33ed57 100644 --- a/plugins/superset-ui-plugins/packages/superset-ui-plugins-demo/storybook/stories/legacy-preset-chart-nvd3/Area/Stories.jsx +++ b/plugins/superset-ui-plugins/packages/superset-ui-plugins-demo/storybook/stories/legacy-preset-chart-nvd3/Area/Stories.jsx @@ -42,4 +42,42 @@ export default [ storyName: 'Stacked', storyPath: 'legacy-|preset-chart-nvd3|AreaChartPlugin', }, + { + renderStory: () => ( + + ), + storyName: 'Expanded', + storyPath: 'legacy-|preset-chart-nvd3|AreaChartPlugin', + }, ];