import { boolean } from '@storybook/addon-knobs' ; import React from 'react' ; import { Axis , BarSeries , Chart , Position , ScaleType , Settings } from '@elastic/charts' ; import { useBaseTheme } from '../../use_base_theme' ; export const Example = ( ) => { const fit = boolean ( 'fit Y domain to data' , true ) ; return ( < Chart > < Settings baseTheme = { useBaseTheme ( ) } / > < Axis id = "bottom" position = { Position . Bottom } title = "Bottom axis" / > < Axis id = "left2" domain = { { min : NaN , max : NaN , fit , } } title = "Left axis" position = { Position . Left } tickFormat = { ( d ) => Number ( d ) . toFixed ( 2 ) } /> < BarSeries id = "bars" xScaleType = { ScaleType . Linear } yScaleType = { ScaleType . Linear } xAccessor = "x" yAccessors = { [ 'y' ] } splitSeriesAccessors = { [ 'g' ] } stackAccessors = { [ 'x' ] } data = { [ { x : 0 , y : 10 , g : 'a' } , { x : 0 , y : 20 , g : 'b' } , { x : 0 , y : 30 , g : 'c' } , ] } / > < /Chart>); } ;