Skip to content

Commit

Permalink
docs: add stacked bar chart with log scale
Browse files Browse the repository at this point in the history
  • Loading branch information
markov00 committed Feb 15, 2019
1 parent f7679a8 commit fd2c49a
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions stories/bar_chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,53 @@ storiesOf('Bar Chart', module)
</Chart>
);
})
.add('with stacked log y axis', () => {
return (
<Chart renderer="canvas" className={'story-chart'}>
<Axis
id={getAxisId('bottom')}
position={Position.Bottom}
title={'Bottom axis'}
showOverlappingTicks={true}
/>
<Axis
id={getAxisId('left2')}
title={'Left axis'}
position={Position.Left}
tickFormat={(d) => Number(d).toFixed(2)}
/>

<BarSeries
id={getSpecId('bars')}
xScaleType={ScaleType.Linear}
yScaleType={ScaleType.Log}
xAccessor="x"
yAccessors={['y']}
splitSeriesAccessors={['g']}
stackAccessors={['x']}
data={[
{ x: 1, y: 0, g: 'a' },
{ x: 1, y: 0, g: 'b' },
{ x: 2, y: 1, g: 'a' },
{ x: 2, y: 1, g: 'b' },
{ x: 3, y: 2, g: 'a' },
{ x: 3, y: 2, g: 'b' },
{ x: 4, y: 3, g: 'a' },
{ x: 4, y: 0, g: 'b' },
{ x: 5, y: 4, g: 'a' },
{ x: 5, y: 0.5, g: 'b' },
{ x: 6, y: 5, g: 'a' },
{ x: 6, y: 1, g: 'b' },
{ x: 7, y: 6, g: 'b' },
{ x: 8, y: 7, g: 'a' },
{ x: 8, y: 10, g: 'b' },
{ x: 9, y: 4, g: 'a' },
]}
yScaleToDataExtent={true}
/>
</Chart>
);
})
.add('with axis and legend', () => {
return (
<Chart renderer="canvas" className={'story-chart'}>
Expand Down

0 comments on commit fd2c49a

Please sign in to comment.