/** * Moves the left side of the current viewport to the specified x-position. * This also refreshes the chart by calling invalidate(). * * @param xValue */ public void moveViewToX(float xValue) { Runnable job = MoveViewJob.getInstance(mViewPortHandler, xValue, 0f, getTransformer(AxisDependency.LEFT), this); addViewportJob(job); }
/** * Zooms in or out by the given scale factor. * x and y are the values (NOT PIXELS) of the zoom center.. * * @param scaleX * @param scaleY * @param xValue * @param yValue * @param axis the axis relative to which the zoom should take place */ public void zoom(float scaleX, float scaleY, float xValue, float yValue, AxisDependency axis) { Runnable job = ZoomJob.getInstance(mViewPortHandler, scaleX, scaleY, xValue, yValue, getTransformer(axis), axis, this); addViewportJob(job); }
/** * Centers the viewport to the specified y value on the y-axis. * This also refreshes the chart by calling invalidate(). * * @param yValue * @param axis - which axis should be used as a reference for the y-axis */ public void centerViewToY(float yValue, AxisDependency axis) { float valsInView = getAxisRange(axis) / mViewPortHandler.getScaleY(); Runnable job = MoveViewJob.getInstance(mViewPortHandler, 0f, yValue + valsInView / 2f, getTransformer(axis), this); addViewportJob(job); }
/** * This will move the left side of the current viewport to the specified * x-value on the x-axis, and center the viewport to the specified y value on the y-axis. * This also refreshes the chart by calling invalidate(). * * @param xValue * @param yValue * @param axis - which axis should be used as a reference for the y-axis */ public void moveViewTo(float xValue, float yValue, AxisDependency axis) { float yInView = getAxisRange(axis) / mViewPortHandler.getScaleY(); Runnable job = MoveViewJob.getInstance(mViewPortHandler, xValue, yValue + yInView / 2f, getTransformer(axis), this); addViewportJob(job); }
/** * This will move the left side of the current viewport to the specified x-value * and center the viewport to the y value animated. * This also refreshes the chart by calling invalidate(). * * @param xValue * @param yValue * @param axis * @param duration the duration of the animation in milliseconds */ @TargetApi(11) public void moveViewToAnimated(float xValue, float yValue, AxisDependency axis, long duration) { MPPointD bounds = getValuesByTouchPoint(mViewPortHandler.contentLeft(), mViewPortHandler.contentTop(), axis); float yInView = getAxisRange(axis) / mViewPortHandler.getScaleY(); Runnable job = AnimatedMoveViewJob.getInstance(mViewPortHandler, xValue, yValue + yInView / 2f, getTransformer(axis), this, (float) bounds.x, (float) bounds.y, duration); addViewportJob(job); MPPointD.recycleInstance(bounds); }
/** * This will move the center of the current viewport to the specified * x and y value. * This also refreshes the chart by calling invalidate(). * * @param xValue * @param yValue * @param axis - which axis should be used as a reference for the y axis */ public void centerViewTo(float xValue, float yValue, AxisDependency axis) { float yInView = getAxisRange(axis) / mViewPortHandler.getScaleY(); float xInView = getXAxis().mAxisRange / mViewPortHandler.getScaleX(); Runnable job = MoveViewJob.getInstance(mViewPortHandler, xValue - xInView / 2f, yValue + yInView / 2f, getTransformer(axis), this); addViewportJob(job); }
/** * Zooms by the specified scale factor to the specified values on the specified axis. * * @param scaleX * @param scaleY * @param xValue * @param yValue * @param axis * @param duration */ @TargetApi(11) public void zoomAndCenterAnimated(float scaleX, float scaleY, float xValue, float yValue, AxisDependency axis, long duration) { MPPointD origin = getValuesByTouchPoint(mViewPortHandler.contentLeft(), mViewPortHandler.contentTop(), axis); Runnable job = AnimatedZoomJob.getInstance(mViewPortHandler, this, getTransformer(axis), getAxis(axis), mXAxis .mAxisRange, scaleX, scaleY, mViewPortHandler.getScaleX(), mViewPortHandler.getScaleY(), xValue, yValue, (float) origin.x, (float) origin.y, duration); addViewportJob(job); MPPointD.recycleInstance(origin); }
/** * This will move the center of the current viewport to the specified * x and y value animated. * * @param xValue * @param yValue * @param axis * @param duration the duration of the animation in milliseconds */ @TargetApi(11) public void centerViewToAnimated(float xValue, float yValue, AxisDependency axis, long duration) { MPPointD bounds = getValuesByTouchPoint(mViewPortHandler.contentLeft(), mViewPortHandler.contentTop(), axis); float yInView = getAxisRange(axis) / mViewPortHandler.getScaleY(); float xInView = getXAxis().mAxisRange / mViewPortHandler.getScaleX(); Runnable job = AnimatedMoveViewJob.getInstance(mViewPortHandler, xValue - xInView / 2f, yValue + yInView / 2f, getTransformer(axis), this, (float) bounds.x, (float) bounds.y, duration); addViewportJob(job); MPPointD.recycleInstance(bounds); }
/** * Moves the left side of the current viewport to the specified x-position. * This also refreshes the chart by calling invalidate(). * * @param xValue */ public void moveViewToX(float xValue) { Runnable job = MoveViewJob.getInstance(mViewPortHandler, xValue, 0f, getTransformer(AxisDependency.LEFT), this); addViewportJob(job); }
/** * Moves the left side of the current viewport to the specified x-position. * This also refreshes the chart by calling invalidate(). * * @param xValue */ public void moveViewToX(float xValue) { Runnable job = MoveViewJob.getInstance(mViewPortHandler, xValue, 0f, getTransformer(AxisDependency.LEFT), this); addViewportJob(job); }
/** * Moves the left side of the current viewport to the specified x-position. * This also refreshes the chart by calling invalidate(). * * @param xValue */ public void moveViewToX(float xValue) { Runnable job = MoveViewJob.getInstance(mViewPortHandler, xValue, 0f, getTransformer(AxisDependency.LEFT), this); addViewportJob(job); }
/** * Moves the left side of the current viewport to the specified x-position. * This also refreshes the chart by calling invalidate(). * * @param xValue */ public void moveViewToX(float xValue) { Runnable job = MoveViewJob.getInstance(mViewPortHandler, xValue, 0f, getTransformer(AxisDependency.LEFT), this); addViewportJob(job); }
/** * Zooms in or out by the given scale factor. * x and y are the values (NOT PIXELS) of the zoom center.. * * @param scaleX * @param scaleY * @param xValue * @param yValue * @param axis the axis relative to which the zoom should take place */ public void zoom(float scaleX, float scaleY, float xValue, float yValue, AxisDependency axis) { Runnable job = ZoomJob.getInstance(mViewPortHandler, scaleX, scaleY, xValue, yValue, getTransformer(axis), axis, this); addViewportJob(job); }
/** * Zooms in or out by the given scale factor. * x and y are the values (NOT PIXELS) of the zoom center.. * * @param scaleX * @param scaleY * @param xValue * @param yValue * @param axis the axis relative to which the zoom should take place */ public void zoom(float scaleX, float scaleY, float xValue, float yValue, AxisDependency axis) { Runnable job = ZoomJob.getInstance(mViewPortHandler, scaleX, scaleY, xValue, yValue, getTransformer(axis), axis, this); addViewportJob(job); }
/** * Zooms in or out by the given scale factor. * x and y are the values (NOT PIXELS) of the zoom center.. * * @param scaleX * @param scaleY * @param xValue * @param yValue * @param axis the axis relative to which the zoom should take place */ public void zoom(float scaleX, float scaleY, float xValue, float yValue, AxisDependency axis) { Runnable job = ZoomJob.getInstance(mViewPortHandler, scaleX, scaleY, xValue, yValue, getTransformer(axis), axis, this); addViewportJob(job); }
/** * Zooms in or out by the given scale factor. * x and y are the values (NOT PIXELS) of the zoom center.. * * @param scaleX * @param scaleY * @param xValue * @param yValue * @param axis the axis relative to which the zoom should take place */ public void zoom(float scaleX, float scaleY, float xValue, float yValue, AxisDependency axis) { Runnable job = ZoomJob.getInstance(mViewPortHandler, scaleX, scaleY, xValue, yValue, getTransformer(axis), axis, this); addViewportJob(job); }
/** * Centers the viewport to the specified y value on the y-axis. * This also refreshes the chart by calling invalidate(). * * @param yValue * @param axis - which axis should be used as a reference for the y-axis */ public void centerViewToY(float yValue, AxisDependency axis) { float valsInView = getAxisRange(axis) / mViewPortHandler.getScaleY(); Runnable job = MoveViewJob.getInstance(mViewPortHandler, 0f, yValue + valsInView / 2f, getTransformer(axis), this); addViewportJob(job); }
/** * Centers the viewport to the specified y value on the y-axis. * This also refreshes the chart by calling invalidate(). * * @param yValue * @param axis - which axis should be used as a reference for the y-axis */ public void centerViewToY(float yValue, AxisDependency axis) { float valsInView = getAxisRange(axis) / mViewPortHandler.getScaleY(); Runnable job = MoveViewJob.getInstance(mViewPortHandler, 0f, yValue + valsInView / 2f, getTransformer(axis), this); addViewportJob(job); }
/** * Centers the viewport to the specified y value on the y-axis. * This also refreshes the chart by calling invalidate(). * * @param yValue * @param axis - which axis should be used as a reference for the y-axis */ public void centerViewToY(float yValue, AxisDependency axis) { float valsInView = getAxisRange(axis) / mViewPortHandler.getScaleY(); Runnable job = MoveViewJob.getInstance(mViewPortHandler, 0f, yValue + valsInView / 2f, getTransformer(axis), this); addViewportJob(job); }
/** * Centers the viewport to the specified y value on the y-axis. * This also refreshes the chart by calling invalidate(). * * @param yValue * @param axis - which axis should be used as a reference for the y-axis */ public void centerViewToY(float yValue, AxisDependency axis) { float valsInView = getAxisRange(axis) / mViewPortHandler.getScaleY(); Runnable job = MoveViewJob.getInstance(mViewPortHandler, 0f, yValue + valsInView / 2f, getTransformer(axis), this); addViewportJob(job); }