diff --git a/packages/superset-ui-legacy-preset-chart-nvd3/src/utils.js b/packages/superset-ui-legacy-preset-chart-nvd3/src/utils.js index a20f4d967..9225a561f 100644 --- a/packages/superset-ui-legacy-preset-chart-nvd3/src/utils.js +++ b/packages/superset-ui-legacy-preset-chart-nvd3/src/utils.js @@ -50,7 +50,7 @@ export function getTimeOrNumberFormatter(format) { export function drawBarValues(svg, data, stacked, axisFormat) { const format = getNumberFormatter(axisFormat); - const countSeriesDisplayed = data.length; + const countSeriesDisplayed = data.filter(d => !d.disabled).length; const totalStackedValues = stacked && data.length !== 0 diff --git a/packages/superset-ui-plugins-demo/storybook/stories/legacy-preset-chart-nvd3/Bar/Stories.jsx b/packages/superset-ui-plugins-demo/storybook/stories/legacy-preset-chart-nvd3/Bar/Stories.jsx index 0e028bbeb..abc56c148 100644 --- a/packages/superset-ui-plugins-demo/storybook/stories/legacy-preset-chart-nvd3/Bar/Stories.jsx +++ b/packages/superset-ui-plugins-demo/storybook/stories/legacy-preset-chart-nvd3/Bar/Stories.jsx @@ -126,4 +126,44 @@ export default [ storyName: 'Bar with positive and negative values', storyPath: 'legacy-|preset-chart-nvd3|BarChartPlugin', }, + { + renderStory: () => ( + + ), + storyName: 'Stacked bar with values', + storyPath: 'legacy-|preset-chart-nvd3|BarChartPlugin', + }, ];