@@ -182,20 +182,20 @@ export abstract class BarLineChartBase<U extends Entry, D extends IBarLineScatte
182
182
// execute all drawing commands
183
183
this . drawGridBackground ( canvas ) ;
184
184
const xAxis = this . xAxis ;
185
- const axisLeft = this . axisLeft ;
186
- const axisRight = this . axisRight ;
185
+ const axisLeft = this . mAxisLeft ;
186
+ const axisRight = this . mAxisRight ;
187
187
188
188
// the order is important:
189
- // * computeAxis needs axis.mAxisMinimum set in autoScale
189
+ // * computeAxis needs axis.axisMinimum set in autoScale
190
190
// * calculateOffsets needs computeAxis because it needs axis longestLabel
191
191
if ( ! noComputeAutoScaleOnNextDraw && this . autoScaleMinMaxEnabled ) {
192
192
this . autoScale ( ) ;
193
193
}
194
194
195
195
if ( ! noComputeAxisOnNextDraw ) {
196
- this . axisRendererLeft . computeAxis ( axisLeft . mAxisMinimum , axisLeft . mAxisMaximum , axisLeft . inverted ) ;
197
- this . axisRendererRight . computeAxis ( axisRight . mAxisMinimum , axisRight . mAxisMaximum , axisRight . inverted ) ;
198
- this . xAxisRenderer . computeAxis ( this . xAxis . mAxisMinimum , this . xAxis . mAxisMaximum , false ) ;
196
+ this . axisRendererLeft ? .computeAxis ( axisLeft . axisMinimum , axisLeft . axisMaximum , axisLeft . inverted ) ;
197
+ this . axisRendererRight ? .computeAxis ( axisRight . axisMinimum , axisRight . axisMaximum , axisRight . inverted ) ;
198
+ this . xAxisRenderer ? .computeAxis ( this . xAxis . axisMinimum , this . xAxis . axisMaximum , false ) ;
199
199
}
200
200
201
201
if ( ! this . offsetsCalculated ) {
@@ -205,19 +205,19 @@ export abstract class BarLineChartBase<U extends Entry, D extends IBarLineScatte
205
205
206
206
if ( xAxis . drawGridLinesBehindData ) this . xAxisRenderer . renderGridLines ( canvas ) ;
207
207
if ( axisLeft . drawGridLinesBehindData ) this . axisRendererLeft . renderGridLines ( canvas ) ;
208
- if ( axisRight . drawGridLinesBehindData ) this . axisRendererRight . renderGridLines ( canvas ) ;
208
+ if ( axisRight ? .drawGridLinesBehindData ) this . axisRendererRight . renderGridLines ( canvas ) ;
209
209
210
210
if ( xAxis . drawLimitLinesBehindData ) this . xAxisRenderer . renderLimitLines ( canvas ) ;
211
211
if ( axisLeft . drawLimitLinesBehindData ) this . axisRendererLeft . renderLimitLines ( canvas ) ;
212
- if ( axisRight . drawLimitLinesBehindData ) this . axisRendererRight . renderLimitLines ( canvas ) ;
212
+ if ( axisRight ? .drawLimitLinesBehindData ) this . axisRendererRight . renderLimitLines ( canvas ) ;
213
213
214
214
this . xAxisRenderer . renderAxisLine ( canvas ) ;
215
215
this . axisRendererLeft . renderAxisLine ( canvas ) ;
216
- this . axisRendererRight . renderAxisLine ( canvas ) ;
216
+ this . axisRendererRight ? .renderAxisLine ( canvas ) ;
217
217
218
218
if ( xAxis . drawLabelsBehindData ) this . xAxisRenderer . renderAxisLabels ( canvas ) ;
219
219
if ( axisLeft . drawLabelsBehindData ) this . axisRendererLeft . renderAxisLabels ( canvas ) ;
220
- if ( axisRight . drawLabelsBehindData ) this . axisRendererRight . renderAxisLabels ( canvas ) ;
220
+ if ( axisRight ? .drawLabelsBehindData ) this . axisRendererRight . renderAxisLabels ( canvas ) ;
221
221
222
222
// make sure the data cannot be drawn outside the content-rect
223
223
if ( this . clipDataToContent ) {
@@ -230,7 +230,7 @@ export abstract class BarLineChartBase<U extends Entry, D extends IBarLineScatte
230
230
231
231
if ( ! xAxis . drawGridLinesBehindData ) this . xAxisRenderer . renderGridLines ( canvas ) ;
232
232
if ( ! axisLeft . drawGridLinesBehindData ) this . axisRendererLeft . renderGridLines ( canvas ) ;
233
- if ( ! axisRight . drawGridLinesBehindData ) this . axisRendererRight . renderGridLines ( canvas ) ;
233
+ if ( axisRight ? .drawGridLinesBehindData === false ) this . axisRendererRight . renderGridLines ( canvas ) ;
234
234
235
235
if ( ! this . clipHighlightToContent && this . clipDataToContent ) {
236
236
// restore before drawing highlight
@@ -249,11 +249,11 @@ export abstract class BarLineChartBase<U extends Entry, D extends IBarLineScatte
249
249
250
250
if ( ! xAxis . drawLimitLinesBehindData ) this . xAxisRenderer . renderLimitLines ( canvas ) ;
251
251
if ( ! axisLeft . drawLimitLinesBehindData ) this . axisRendererLeft . renderLimitLines ( canvas ) ;
252
- if ( ! axisRight . drawLimitLinesBehindData ) this . axisRendererRight . renderLimitLines ( canvas ) ;
252
+ if ( axisRight ? .drawLimitLinesBehindData === false ) this . axisRendererRight . renderLimitLines ( canvas ) ;
253
253
254
254
if ( ! xAxis . drawLabelsBehindData ) this . xAxisRenderer . renderAxisLabels ( canvas ) ;
255
255
if ( ! axisLeft . drawLabelsBehindData ) this . axisRendererLeft . renderAxisLabels ( canvas ) ;
256
- if ( ! axisRight . drawLabelsBehindData ) this . axisRendererRight . renderAxisLabels ( canvas ) ;
256
+ if ( axisRight ? .drawLabelsBehindData === false ) this . axisRendererRight . renderAxisLabels ( canvas ) ;
257
257
258
258
if ( this . clipValuesToContent ) {
259
259
canvas . save ( ) ;
@@ -291,13 +291,13 @@ export abstract class BarLineChartBase<U extends Entry, D extends IBarLineScatte
291
291
292
292
protected prepareValuePxMatrix ( ) {
293
293
if ( Trace . isEnabled ( ) ) {
294
- CLog ( CLogTypes . info , LOG_TAG , 'Preparing Value-Px Matrix, xmin: ' + this . xAxis . mAxisMinimum + ', xmax: ' + this . xAxis . mAxisMaximum + ', xdelta: ' + this . xAxis . mAxisRange ) ;
294
+ CLog ( CLogTypes . info , LOG_TAG , 'Preparing Value-Px Matrix, xmin: ' + this . xAxis . axisMinimum + ', xmax: ' + this . xAxis . axisMaximum + ', xdelta: ' + this . xAxis . axisRange ) ;
295
295
}
296
296
if ( this . mAxisRight ?. enabled ) {
297
- this . rightAxisTransformer . prepareMatrixValuePx ( this . xAxis . mAxisMinimum , this . xAxis . mAxisRange , this . mAxisRight . mAxisRange , this . mAxisRight . mAxisMinimum ) ;
297
+ this . rightAxisTransformer . prepareMatrixValuePx ( this . xAxis . axisMinimum , this . xAxis . axisRange , this . mAxisRight . axisRange , this . mAxisRight . axisMinimum ) ;
298
298
}
299
299
if ( this . mAxisLeft ?. enabled || this . xAxis . enabled ) {
300
- this . leftAxisTransformer . prepareMatrixValuePx ( this . xAxis . mAxisMinimum , this . xAxis . mAxisRange , this . mAxisLeft . mAxisRange , this . mAxisLeft . mAxisMinimum ) ;
300
+ this . leftAxisTransformer . prepareMatrixValuePx ( this . xAxis . axisMinimum , this . xAxis . axisRange , this . mAxisLeft . axisRange , this . mAxisLeft . axisMinimum ) ;
301
301
}
302
302
}
303
303
@@ -332,13 +332,13 @@ export abstract class BarLineChartBase<U extends Entry, D extends IBarLineScatte
332
332
this . calcMinMax ( ) ;
333
333
334
334
if ( this . mAxisLeft ?. enabled ) {
335
- this . axisRendererLeft . computeAxis ( this . mAxisLeft . mAxisMinimum , this . mAxisLeft . mAxisMaximum , this . mAxisLeft . inverted ) ;
335
+ this . axisRendererLeft . computeAxis ( this . mAxisLeft . axisMinimum , this . mAxisLeft . axisMaximum , this . mAxisLeft . inverted ) ;
336
336
}
337
337
if ( this . mAxisRight ?. enabled ) {
338
- this . axisRendererRight . computeAxis ( this . mAxisRight . mAxisMinimum , this . mAxisRight . mAxisMaximum , this . mAxisRight . inverted ) ;
338
+ this . axisRendererRight . computeAxis ( this . mAxisRight . axisMinimum , this . mAxisRight . axisMaximum , this . mAxisRight . inverted ) ;
339
339
}
340
340
if ( this . xAxis . enabled ) {
341
- this . xAxisRenderer . computeAxis ( this . xAxis . mAxisMinimum , this . xAxis . mAxisMaximum , false ) ;
341
+ this . xAxisRenderer . computeAxis ( this . xAxis . axisMinimum , this . xAxis . axisMaximum , false ) ;
342
342
}
343
343
344
344
if ( this . mLegend != null && this . mLegend . enabled ) {
@@ -667,7 +667,7 @@ export abstract class BarLineChartBase<U extends Entry, D extends IBarLineScatte
667
667
this ,
668
668
this . getTransformer ( axis ) ,
669
669
this . getAxis ( axis ) ,
670
- this . xAxis . mAxisRange ,
670
+ this . xAxis . axisRange ,
671
671
scaleX ,
672
672
scaleY ,
673
673
this . viewPortHandler . getScaleX ( ) ,
@@ -698,7 +698,7 @@ export abstract class BarLineChartBase<U extends Entry, D extends IBarLineScatte
698
698
this ,
699
699
this . getTransformer ( axis ) ,
700
700
this . getAxis ( axis ) ,
701
- this . xAxis . mAxisRange ,
701
+ this . xAxis . axisRange ,
702
702
scaleX ,
703
703
scaleY ,
704
704
this . viewPortHandler . getScaleX ( ) ,
@@ -759,7 +759,7 @@ export abstract class BarLineChartBase<U extends Entry, D extends IBarLineScatte
759
759
* @param maxXRange The maximum visible range of x-values.
760
760
*/
761
761
public set visibleXRangeMaximum ( maxXRange ) {
762
- const xScale = this . xAxis . mAxisRange / maxXRange ;
762
+ const xScale = this . xAxis . axisRange / maxXRange ;
763
763
this . viewPortHandler . setMinimumScaleX ( xScale ) ;
764
764
}
765
765
@@ -772,7 +772,7 @@ export abstract class BarLineChartBase<U extends Entry, D extends IBarLineScatte
772
772
* @param minXRange The minimum visible range of x-values.
773
773
*/
774
774
public set visibleXRangeMinimum ( minXRange ) {
775
- const xScale = this . xAxis . mAxisRange / minXRange ;
775
+ const xScale = this . xAxis . axisRange / minXRange ;
776
776
this . viewPortHandler . setMaximumScaleX ( xScale ) ;
777
777
}
778
778
@@ -785,8 +785,8 @@ export abstract class BarLineChartBase<U extends Entry, D extends IBarLineScatte
785
785
* @param maxXRange
786
786
*/
787
787
public setVisibleXRange ( minXRange , maxXRange ) {
788
- const minScale = this . xAxis . mAxisRange / minXRange ;
789
- const maxScale = this . xAxis . mAxisRange / maxXRange ;
788
+ const minScale = this . xAxis . axisRange / minXRange ;
789
+ const maxScale = this . xAxis . axisRange / maxXRange ;
790
790
this . viewPortHandler . setMinMaxScaleX ( minScale , maxScale ) ;
791
791
}
792
792
@@ -902,7 +902,7 @@ export abstract class BarLineChartBase<U extends Entry, D extends IBarLineScatte
902
902
*/
903
903
public centerViewTo ( xValue , yValue , axis ) {
904
904
const yInView = this . getAxisRange ( axis ) / this . viewPortHandler . getScaleY ( ) ;
905
- const xInView = this . xAxis . mAxisRange / this . viewPortHandler . getScaleX ( ) ;
905
+ const xInView = this . xAxis . axisRange / this . viewPortHandler . getScaleX ( ) ;
906
906
907
907
const job = MoveViewJob . getInstance ( this . viewPortHandler , xValue - xInView / 2 , yValue + yInView / 2 , this . getTransformer ( axis ) , this ) ;
908
908
@@ -922,7 +922,7 @@ export abstract class BarLineChartBase<U extends Entry, D extends IBarLineScatte
922
922
const bounds = this . getValuesByTouchPoint ( this . viewPortHandler . contentLeft , this . viewPortHandler . contentTop , axis ) ;
923
923
924
924
const yInView = this . getAxisRange ( axis ) / this . viewPortHandler . getScaleY ( ) ;
925
- const xInView = this . xAxis . mAxisRange / this . viewPortHandler . getScaleX ( ) ;
925
+ const xInView = this . xAxis . axisRange / this . viewPortHandler . getScaleX ( ) ;
926
926
927
927
const job = AnimatedMoveViewJob . getInstance ( this . viewPortHandler , xValue - xInView / 2 , yValue + yInView / 2 , this . getTransformer ( axis ) , this , bounds . x , bounds . y , duration ) ;
928
928
@@ -982,8 +982,8 @@ export abstract class BarLineChartBase<U extends Entry, D extends IBarLineScatte
982
982
* @return
983
983
*/
984
984
protected getAxisRange ( axis ) {
985
- if ( axis === AxisDependency . LEFT ) return this . mAxisLeft . mAxisRange ;
986
- else return this . mAxisRight && this . mAxisRight . mAxisRange ;
985
+ if ( axis === AxisDependency . LEFT ) return this . mAxisLeft . axisRange ;
986
+ else return this . mAxisRight && this . mAxisRight . axisRange ;
987
987
}
988
988
989
989
/**
@@ -1231,7 +1231,7 @@ export abstract class BarLineChartBase<U extends Entry, D extends IBarLineScatte
1231
1231
*/
1232
1232
public get lowestVisibleX ( ) {
1233
1233
this . transformer . getValuesByTouchPoint ( this . viewPortHandler . contentLeft , this . viewPortHandler . contentBottom , this . posForGetLowestVisibleX ) ;
1234
- const result = Math . max ( this . xAxis . mAxisMinimum , this . posForGetLowestVisibleX . x ) ;
1234
+ const result = Math . max ( this . xAxis . axisMinimum , this . posForGetLowestVisibleX . x ) ;
1235
1235
return result ;
1236
1236
}
1237
1237
@@ -1246,7 +1246,7 @@ export abstract class BarLineChartBase<U extends Entry, D extends IBarLineScatte
1246
1246
*/
1247
1247
public get highestVisibleX ( ) {
1248
1248
this . transformer . getValuesByTouchPoint ( this . viewPortHandler . contentRight , this . viewPortHandler . contentBottom , this . posForGetHighestVisibleX ) ;
1249
- const result = Math . min ( this . xAxis . mAxisMaximum , this . posForGetHighestVisibleX . x ) ;
1249
+ const result = Math . min ( this . xAxis . axisMaximum , this . posForGetHighestVisibleX . x ) ;
1250
1250
return result ;
1251
1251
}
1252
1252
@@ -1398,21 +1398,21 @@ export abstract class BarLineChartBase<U extends Entry, D extends IBarLineScatte
1398
1398
public get yChartMax ( ) {
1399
1399
let max = - Infinity ;
1400
1400
if ( this . mAxisLeft . enabled ) {
1401
- max = Math . max ( this . mAxisLeft . mAxisMaximum , max ) ;
1401
+ max = Math . max ( this . mAxisLeft . axisMaximum , max ) ;
1402
1402
}
1403
1403
if ( this . mAxisRight ?. enabled ) {
1404
- max = Math . max ( this . mAxisRight . mAxisMaximum , max ) ;
1404
+ max = Math . max ( this . mAxisRight . axisMaximum , max ) ;
1405
1405
}
1406
1406
return max ;
1407
1407
}
1408
1408
1409
1409
public get yChartMin ( ) {
1410
1410
let min = Infinity ;
1411
1411
if ( this . mAxisLeft . enabled ) {
1412
- min = Math . min ( this . mAxisLeft . mAxisMinimum , min ) ;
1412
+ min = Math . min ( this . mAxisLeft . axisMinimum , min ) ;
1413
1413
}
1414
1414
if ( this . mAxisRight ?. enabled ) {
1415
- min = Math . min ( this . mAxisRight . mAxisMinimum , min ) ;
1415
+ min = Math . min ( this . mAxisRight . axisMinimum , min ) ;
1416
1416
}
1417
1417
return min ;
1418
1418
}
0 commit comments