@@ -262,7 +262,7 @@ export abstract class BarLineChartBase<U extends Entry, D extends IBarLineScatte
262
262
263
263
this . drawMarkers ( canvas ) ;
264
264
265
- this . notify ( { eventName : 'drawn' , object : this } ) ;
265
+ this . notify ( { eventName : 'postDraw' , canvas , object : this } ) ;
266
266
if ( Trace . isEnabled ( ) ) {
267
267
const drawtime = Date . now ( ) - startTime ;
268
268
this . totalTime += drawtime ;
@@ -610,7 +610,7 @@ export abstract class BarLineChartBase<U extends Entry, D extends IBarLineScatte
610
610
this . mViewPortHandler . zoomAtPosition ( scaleX , scaleY , x , y , this . mZoomMatrixBuffer ) ;
611
611
this . mViewPortHandler . refresh ( this . mZoomMatrixBuffer , this , false ) ;
612
612
613
- // Range might have changed, which means that Y-axis labels
613
+ // Range might have changed, which means that Y-axis labels
614
614
// could have changed in size, affecting Y-axis size.
615
615
// So we need to recalculate offsets.
616
616
this . calculateOffsets ( ) ;
@@ -640,7 +640,6 @@ export abstract class BarLineChartBase<U extends Entry, D extends IBarLineScatte
640
640
*/
641
641
public zoomToCenter ( scaleX , scaleY ) {
642
642
const center = this . getCenterOffsets ( ) ;
643
-
644
643
const save = this . mZoomMatrixBuffer ;
645
644
this . mViewPortHandler . zoomAtPosition ( scaleX , scaleY , center . x , - center . y , save ) ;
646
645
this . mViewPortHandler . refresh ( save , this , false ) ;
@@ -678,6 +677,38 @@ export abstract class BarLineChartBase<U extends Entry, D extends IBarLineScatte
678
677
this . addViewportJob ( job ) ;
679
678
}
680
679
680
+ /**
681
+ * Zooms by the specified scale factor to the specified values on the specified axis.
682
+ *
683
+ * @param scaleX
684
+ * @param scaleY
685
+ * @param xValue
686
+ * @param yValue
687
+ * @param axis
688
+ */
689
+ public zoomAndCenter ( scaleX , scaleY , xValue , yValue , axis ) {
690
+ const origin = this . getValuesByTouchPoint ( this . mViewPortHandler . contentLeft ( ) , this . mViewPortHandler . contentTop ( ) , axis ) ;
691
+
692
+ const job = AnimatedZoomJob . getInstance (
693
+ this . mViewPortHandler ,
694
+ this ,
695
+ this . getTransformer ( axis ) ,
696
+ this . getAxis ( axis ) ,
697
+ this . mXAxis . mAxisRange ,
698
+ scaleX ,
699
+ scaleY ,
700
+ this . mViewPortHandler . getScaleX ( ) ,
701
+ this . mViewPortHandler . getScaleY ( ) ,
702
+ xValue ,
703
+ yValue ,
704
+ origin . x ,
705
+ origin . y ,
706
+ 0
707
+ ) ;
708
+ job . setPhase ( 1 ) ;
709
+ job . onAnimationUpdate ( 0 ) ;
710
+ }
711
+
681
712
protected mFitScreenMatrixBuffer = new Matrix ( ) ;
682
713
683
714
/**
0 commit comments