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

Commit

Permalink
fix(legacy-preset-chart-nvd3): stacked bar charts labels (#40)
Browse files Browse the repository at this point in the history
* fix(legacy-preset-chart-nvd3): stacked bar charts labels

* fix(legacy-preset-chart-nvd3): fix lint
  • Loading branch information
betodealmeida authored Apr 4, 2019
1 parent df96c4a commit ec67d3d
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/superset-ui-legacy-preset-chart-nvd3/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,44 @@ export default [
storyName: 'Bar with positive and negative values',
storyPath: 'legacy-|preset-chart-nvd3|BarChartPlugin',
},
{
renderStory: () => (
<SuperChart
chartType="bar"
chartProps={{
datasource: {
verboseMap: {},
},
formData: {
barStacked: true,
bottomMargin: 'auto',
colorCcheme: 'd3Category10',
contribution: false,
groupby: ['region'],
lineInterpolation: 'linear',
metrics: ['sum__SP_POP_TOTL'],
richTooltip: true,
showBarValue: true,
showBrush: 'auto',
showControls: false,
showLegend: true,
stackedStyle: 'stack',
vizType: 'bar',
xAxisFormat: '%Y',
xAxisLabel: '',
xAxisShowminmax: false,
xTicksLayout: 'auto',
yAxisBounds: [null, null],
yAxisFormat: '.3s',
yLogScale: false,
},
height: 400,
payload: { data },
width: 400,
}}
/>
),
storyName: 'Stacked bar with values',
storyPath: 'legacy-|preset-chart-nvd3|BarChartPlugin',
},
];

0 comments on commit ec67d3d

Please sign in to comment.