@@ -14,12 +14,12 @@ function extractValues(data: ISerializedDataFrame, seriesConfigs: IYAxisSeriesCo
1414 return flattened ;
1515}
1616
17- function findMin ( values : number [ ] ) : number {
18- return Math . min ( ...values . filter ( v => v !== undefined && v !== null && ! Number . isNaN ( v ) ) ) ;
17+ function computeMin ( values : number [ ] ) : number {
18+ return Math . floor ( Math . min ( ...values . filter ( v => v !== undefined && v !== null && ! Number . isNaN ( v ) ) ) * 100 ) / 100 ;
1919}
2020
21- function findMax ( values : number [ ] ) : number {
22- return Math . max ( ...values . filter ( v => v !== undefined && v !== null && ! Number . isNaN ( v ) && Number . isFinite ( v ) ) ) ;
21+ function computeMax ( values : number [ ] ) : number {
22+ return Math . ceil ( Math . max ( ...values . filter ( v => v !== undefined && v !== null && ! Number . isNaN ( v ) && Number . isFinite ( v ) ) ) * 100 ) / 100 ;
2323}
2424
2525//
@@ -87,7 +87,7 @@ export function applyDefaults(inputChartDef: IChartDef, plotDefaults?: IPlotConf
8787 y1Values = extractValues ( chartDef . data , chartDef . axisMap . y ) ;
8888
8989 if ( y1Values . length > 0 ) {
90- chartDef . plotConfig . y . min = findMin ( y1Values ) ;
90+ chartDef . plotConfig . y . min = computeMin ( y1Values ) ;
9191 }
9292 }
9393
@@ -97,7 +97,7 @@ export function applyDefaults(inputChartDef: IChartDef, plotDefaults?: IPlotConf
9797 }
9898
9999 if ( y1Values . length > 0 ) {
100- chartDef . plotConfig . y . max = findMax ( y1Values ) ;
100+ chartDef . plotConfig . y . max = computeMax ( y1Values ) ;
101101 }
102102 }
103103
@@ -110,7 +110,7 @@ export function applyDefaults(inputChartDef: IChartDef, plotDefaults?: IPlotConf
110110 if ( chartDef . plotConfig . y2 . min === undefined ) {
111111 y2Values = extractValues ( chartDef . data , chartDef . axisMap . y2 ) ;
112112 if ( y2Values . length > 0 ) {
113- chartDef . plotConfig . y2 . min = findMin ( y2Values ) ;
113+ chartDef . plotConfig . y2 . min = computeMin ( y2Values ) ;
114114 }
115115 }
116116
@@ -120,7 +120,7 @@ export function applyDefaults(inputChartDef: IChartDef, plotDefaults?: IPlotConf
120120 }
121121
122122 if ( y2Values . length > 0 ) {
123- chartDef . plotConfig . y2 . max = findMax ( y2Values ) ;
123+ chartDef . plotConfig . y2 . max = computeMax ( y2Values ) ;
124124 }
125125 }
126126
0 commit comments