@@ -21,6 +21,9 @@ import {
2121 Settings ,
2222 BaseThemeTypes ,
2323 LineSeriesStyle ,
24+ TooltipType ,
25+ RecursivePartial ,
26+ Theme ,
2427} from '../src/' ;
2528import * as TestDatasets from '../src/utils/data_samples/test_dataset' ;
2629import { palettes } from '../src/utils/themes/colors' ;
@@ -103,6 +106,75 @@ const data2 = dg.generateSimpleSeries(40);
103106const data3 = dg . generateSimpleSeries ( 40 ) ;
104107
105108storiesOf ( 'Stylings' , module )
109+ . add ( 'chart size' , ( ) => {
110+ const theme : RecursivePartial < Theme > = {
111+ chartMargins : {
112+ bottom : 0 ,
113+ left : 0 ,
114+ top : 0 ,
115+ right : 0 ,
116+ } ,
117+ } ;
118+ return (
119+ < div >
120+ < Chart className = { 'story-chart' } size = { { width : 100 , height : 50 } } >
121+ < Settings tooltip = { TooltipType . None } theme = { theme } />
122+ < BarSeries
123+ id = { getSpecId ( 'bars' ) }
124+ xScaleType = { ScaleType . Linear }
125+ yScaleType = { ScaleType . Linear }
126+ xAccessor = "x"
127+ yAccessors = { [ 'y' ] }
128+ data = { data2 }
129+ />
130+ </ Chart >
131+ < Chart className = { 'story-chart' } size = { { height : 50 } } >
132+ < Settings tooltip = { TooltipType . None } theme = { theme } />
133+ < BarSeries
134+ id = { getSpecId ( 'bars' ) }
135+ xScaleType = { ScaleType . Linear }
136+ yScaleType = { ScaleType . Linear }
137+ xAccessor = "x"
138+ yAccessors = { [ 'y' ] }
139+ data = { data2 }
140+ />
141+ </ Chart >
142+ < Chart className = { 'story-chart' } size = { [ '50%' , 50 ] } >
143+ < Settings tooltip = { TooltipType . None } theme = { theme } />
144+ < BarSeries
145+ id = { getSpecId ( 'bars' ) }
146+ xScaleType = { ScaleType . Linear }
147+ yScaleType = { ScaleType . Linear }
148+ xAccessor = "x"
149+ yAccessors = { [ 'y' ] }
150+ data = { data2 }
151+ />
152+ </ Chart >
153+ < Chart className = { 'story-chart' } size = { [ undefined , 50 ] } >
154+ < Settings tooltip = { TooltipType . None } theme = { theme } />
155+ < BarSeries
156+ id = { getSpecId ( 'bars' ) }
157+ xScaleType = { ScaleType . Linear }
158+ yScaleType = { ScaleType . Linear }
159+ xAccessor = "x"
160+ yAccessors = { [ 'y' ] }
161+ data = { data2 }
162+ />
163+ </ Chart >
164+ < Chart className = { 'story-chart' } size = { 50 } >
165+ < Settings tooltip = { TooltipType . None } theme = { theme } />
166+ < BarSeries
167+ id = { getSpecId ( 'bars' ) }
168+ xScaleType = { ScaleType . Linear }
169+ yScaleType = { ScaleType . Linear }
170+ xAccessor = "x"
171+ yAccessors = { [ 'y' ] }
172+ data = { data2 }
173+ />
174+ </ Chart >
175+ </ div >
176+ ) ;
177+ } )
106178 . add ( 'margins and paddings' , ( ) => {
107179 const theme : PartialTheme = {
108180 chartMargins : {
0 commit comments