Skip to content
This repository has been archived by the owner on Dec 10, 2021. 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 committed Apr 4, 2019
1 parent 9a9337a commit 744f7c8
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
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 744f7c8

Please sign in to comment.