@@ -504,7 +504,13 @@ export abstract class BarLineChartBase<U extends Entry, D extends IBarLineScatte
504
504
*
505
505
* @return
506
506
*/
507
- public getTransformer ( which : AxisDependency ) {
507
+ public getTransformer ( which ?: AxisDependency ) {
508
+ if ( which === undefined ) {
509
+ if ( this . getAxisLeft ( ) . isEnabled ( ) ) {
510
+ return this . mLeftAxisTransformer ;
511
+ }
512
+ return this . mRightAxisTransformer ;
513
+ }
508
514
if ( which === AxisDependency . LEFT ) return this . mLeftAxisTransformer ;
509
515
else return this . mRightAxisTransformer ;
510
516
}
@@ -781,7 +787,7 @@ export abstract class BarLineChartBase<U extends Entry, D extends IBarLineScatte
781
787
* @param xValue
782
788
*/
783
789
public moveViewToX ( xValue ) {
784
- const job = MoveViewJob . getInstance ( this . mViewPortHandler , xValue , 0 , this . getTransformer ( AxisDependency . LEFT ) , this ) ;
790
+ const job = MoveViewJob . getInstance ( this . mViewPortHandler , xValue , 0 , this . getTransformer ( ) , this ) ;
785
791
this . addViewportJob ( job ) ;
786
792
}
787
793
@@ -1332,7 +1338,7 @@ export abstract class BarLineChartBase<U extends Entry, D extends IBarLineScatte
1332
1338
*/
1333
1339
1334
1340
public getLowestVisibleX ( ) {
1335
- this . getTransformer ( AxisDependency . LEFT ) . getValuesByTouchPoint ( this . mViewPortHandler . contentLeft ( ) , this . mViewPortHandler . contentBottom ( ) , this . posForGetLowestVisibleX ) ;
1341
+ this . getTransformer ( ) . getValuesByTouchPoint ( this . mViewPortHandler . contentLeft ( ) , this . mViewPortHandler . contentBottom ( ) , this . posForGetLowestVisibleX ) ;
1336
1342
const result = Math . max ( this . mXAxis . mAxisMinimum , this . posForGetLowestVisibleX . x ) ;
1337
1343
return result ;
1338
1344
}
@@ -1350,7 +1356,7 @@ export abstract class BarLineChartBase<U extends Entry, D extends IBarLineScatte
1350
1356
*/
1351
1357
1352
1358
public getHighestVisibleX ( ) {
1353
- this . getTransformer ( AxisDependency . LEFT ) . getValuesByTouchPoint ( this . mViewPortHandler . contentRight ( ) , this . mViewPortHandler . contentBottom ( ) , this . posForGetHighestVisibleX ) ;
1359
+ this . getTransformer ( ) . getValuesByTouchPoint ( this . mViewPortHandler . contentRight ( ) , this . mViewPortHandler . contentBottom ( ) , this . posForGetHighestVisibleX ) ;
1354
1360
const result = Math . min ( this . mXAxis . mAxisMaximum , this . posForGetHighestVisibleX . x ) ;
1355
1361
1356
1362
return result ;
@@ -1602,15 +1608,15 @@ export abstract class BarLineChartBase<U extends Entry, D extends IBarLineScatte
1602
1608
if ( this . mKeepPositionOnRotation ) {
1603
1609
this . mOnSizeChangedBuffer [ 0 ] = this . mViewPortHandler . contentLeft ( ) ;
1604
1610
this . mOnSizeChangedBuffer [ 1 ] = this . mViewPortHandler . contentTop ( ) ;
1605
- this . getTransformer ( AxisDependency . LEFT ) . pixelsToValue ( this . mOnSizeChangedBuffer ) ;
1611
+ this . getTransformer ( ) . pixelsToValue ( this . mOnSizeChangedBuffer ) ;
1606
1612
}
1607
1613
1608
1614
//Superclass transforms chart.
1609
1615
super . onSizeChanged ( w , h , oldw , oldh ) ;
1610
1616
1611
1617
if ( this . mKeepPositionOnRotation ) {
1612
1618
//Restoring old position of chart.
1613
- this . getTransformer ( AxisDependency . LEFT ) . pointValuesToPixel ( this . mOnSizeChangedBuffer ) ;
1619
+ this . getTransformer ( ) . pointValuesToPixel ( this . mOnSizeChangedBuffer ) ;
1614
1620
this . mViewPortHandler . centerViewPort ( this . mOnSizeChangedBuffer , this ) ;
1615
1621
} else {
1616
1622
// a resize of the view will redraw the view anyway?
0 commit comments