@@ -14,12 +14,12 @@ function extractValues(data: ISerializedDataFrame, seriesConfigs: IYAxisSeriesCo
14
14
return flattened ;
15
15
}
16
16
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 ;
19
19
}
20
20
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 ;
23
23
}
24
24
25
25
//
@@ -87,7 +87,7 @@ export function applyDefaults(inputChartDef: IChartDef, plotDefaults?: IPlotConf
87
87
y1Values = extractValues ( chartDef . data , chartDef . axisMap . y ) ;
88
88
89
89
if ( y1Values . length > 0 ) {
90
- chartDef . plotConfig . y . min = findMin ( y1Values ) ;
90
+ chartDef . plotConfig . y . min = computeMin ( y1Values ) ;
91
91
}
92
92
}
93
93
@@ -97,7 +97,7 @@ export function applyDefaults(inputChartDef: IChartDef, plotDefaults?: IPlotConf
97
97
}
98
98
99
99
if ( y1Values . length > 0 ) {
100
- chartDef . plotConfig . y . max = findMax ( y1Values ) ;
100
+ chartDef . plotConfig . y . max = computeMax ( y1Values ) ;
101
101
}
102
102
}
103
103
@@ -110,7 +110,7 @@ export function applyDefaults(inputChartDef: IChartDef, plotDefaults?: IPlotConf
110
110
if ( chartDef . plotConfig . y2 . min === undefined ) {
111
111
y2Values = extractValues ( chartDef . data , chartDef . axisMap . y2 ) ;
112
112
if ( y2Values . length > 0 ) {
113
- chartDef . plotConfig . y2 . min = findMin ( y2Values ) ;
113
+ chartDef . plotConfig . y2 . min = computeMin ( y2Values ) ;
114
114
}
115
115
}
116
116
@@ -120,7 +120,7 @@ export function applyDefaults(inputChartDef: IChartDef, plotDefaults?: IPlotConf
120
120
}
121
121
122
122
if ( y2Values . length > 0 ) {
123
- chartDef . plotConfig . y2 . max = findMax ( y2Values ) ;
123
+ chartDef . plotConfig . y2 . max = computeMax ( y2Values ) ;
124
124
}
125
125
}
126
126
0 commit comments