diff --git a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/DistBar/controlPanel.ts b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/DistBar/controlPanel.ts index d0f83ddd9162..b1459ddea8a4 100644 --- a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/DistBar/controlPanel.ts +++ b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/DistBar/controlPanel.ts @@ -35,6 +35,7 @@ import { yAxisLabel, yAxisShowMinmax, yAxisBounds, + richTooltip, } from '../NVD3Controls'; const config: ControlPanelConfig = { @@ -81,6 +82,7 @@ const config: ControlPanelConfig = { ['color_scheme'], [showLegend], [showBarValue], + [richTooltip], [barStacked], [ { diff --git a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/NVD3Vis.js b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/NVD3Vis.js index 66bf9328ae00..7f3d4d08d4fe 100644 --- a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/NVD3Vis.js +++ b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/NVD3Vis.js @@ -673,9 +673,9 @@ function nvd3Vis(element, props) { chart.color(d => d.color || colorFn(cleanColorInput(d[colorKey]))); } - if (isVizTypes(['line', 'area']) && useRichTooltip) { + if (isVizTypes(['line', 'area', 'bar', 'dist_bar']) && useRichTooltip) { chart.useInteractiveGuideline(true); - if (vizType === 'line') { + if (vizType === 'line' || vizType === 'bar') { chart.interactiveLayer.tooltip.contentGenerator(d => generateRichLineTooltipContent( d, @@ -683,6 +683,10 @@ function nvd3Vis(element, props) { yAxisFormatter, ), ); + } else if (vizType === 'dist_bar') { + chart.interactiveLayer.tooltip.contentGenerator(d => + generateCompareTooltipContent(d, yAxisFormatter), + ); } else { // area chart chart.interactiveLayer.tooltip.contentGenerator(d =>