/** * Limits the maximum and minimum y range that can be visible by pinching and zooming. * * @param minYRange * @param maxYRange * @param axis */ public void setVisibleYRange(float minYRange, float maxYRange, AxisDependency axis) { float minScale = getAxisRange(axis) / minYRange; float maxScale = getAxisRange(axis) / maxYRange; mViewPortHandler.setMinMaxScaleY(minScale, maxScale); }
/** * Sets the size of the area (range on the y-axis) that should be maximum * visible at once. * * @param maxYRange the maximum visible range on the y-axis * @param axis the axis for which this limit should apply */ public void setVisibleYRangeMaximum(float maxYRange, AxisDependency axis) { float yScale = getAxisRange(axis) / maxYRange; mViewPortHandler.setMinimumScaleY(yScale); }
/** * Sets the size of the area (range on the y-axis) that should be minimum visible at once, no further zooming in possible. * * @param minYRange * @param axis the axis for which this limit should apply */ public void setVisibleYRangeMinimum(float minYRange, AxisDependency axis) { float yScale = getAxisRange(axis) / minYRange; mViewPortHandler.setMaximumScaleY(yScale); }
/** * 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 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); }
/** * 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 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); }
/** * Limits the maximum and minimum y range that can be visible by pinching and zooming. * * @param minYRange * @param maxYRange * @param axis */ public void setVisibleYRange(float minYRange, float maxYRange, AxisDependency axis) { float minScale = getAxisRange(axis) / minYRange; float maxScale = getAxisRange(axis) / maxYRange; mViewPortHandler.setMinMaxScaleY(minScale, maxScale); }
/** * Limits the maximum and minimum y range that can be visible by pinching and zooming. * * @param minYRange * @param maxYRange * @param axis */ public void setVisibleYRange(float minYRange, float maxYRange, AxisDependency axis) { float minScale = getAxisRange(axis) / minYRange; float maxScale = getAxisRange(axis) / maxYRange; mViewPortHandler.setMinMaxScaleY(minScale, maxScale); }
/** * Limits the maximum and minimum y range that can be visible by pinching and zooming. * * @param minYRange * @param maxYRange * @param axis */ public void setVisibleYRange(float minYRange, float maxYRange, AxisDependency axis) { float minScale = getAxisRange(axis) / minYRange; float maxScale = getAxisRange(axis) / maxYRange; mViewPortHandler.setMinMaxScaleY(minScale, maxScale); }
/** * Limits the maximum and minimum y range that can be visible by pinching and zooming. * * @param minYRange * @param maxYRange * @param axis */ public void setVisibleYRange(float minYRange, float maxYRange, AxisDependency axis) { float minScale = getAxisRange(axis) / minYRange; float maxScale = getAxisRange(axis) / maxYRange; mViewPortHandler.setMinMaxScaleY(minScale, maxScale); }
/** * Sets the size of the area (range on the y-axis) that should be minimum visible at once, no further zooming in possible. * * @param minYRange * @param axis the axis for which this limit should apply */ public void setVisibleYRangeMinimum(float minYRange, AxisDependency axis) { float yScale = getAxisRange(axis) / minYRange; mViewPortHandler.setMaximumScaleY(yScale); }
/** * Sets the size of the area (range on the y-axis) that should be maximum * visible at once. * * @param maxYRange the maximum visible range on the y-axis * @param axis the axis for which this limit should apply */ public void setVisibleYRangeMaximum(float maxYRange, AxisDependency axis) { float yScale = getAxisRange(axis) / maxYRange; mViewPortHandler.setMinimumScaleY(yScale); }
/** * Sets the size of the area (range on the y-axis) that should be maximum * visible at once. * * @param maxYRange the maximum visible range on the y-axis * @param axis the axis for which this limit should apply */ public void setVisibleYRangeMaximum(float maxYRange, AxisDependency axis) { float yScale = getAxisRange(axis) / maxYRange; mViewPortHandler.setMinimumScaleY(yScale); }
/** * Sets the size of the area (range on the y-axis) that should be minimum visible at once, no further zooming in possible. * * @param minYRange * @param axis the axis for which this limit should apply */ public void setVisibleYRangeMinimum(float minYRange, AxisDependency axis) { float yScale = getAxisRange(axis) / minYRange; mViewPortHandler.setMaximumScaleY(yScale); }
/** * Sets the size of the area (range on the y-axis) that should be minimum visible at once, no further zooming in possible. * * @param minYRange * @param axis the axis for which this limit should apply */ public void setVisibleYRangeMinimum(float minYRange, AxisDependency axis) { float yScale = getAxisRange(axis) / minYRange; mViewPortHandler.setMaximumScaleY(yScale); }
/** * Sets the size of the area (range on the y-axis) that should be maximum * visible at once. * * @param maxYRange the maximum visible range on the y-axis * @param axis the axis for which this limit should apply */ public void setVisibleYRangeMaximum(float maxYRange, AxisDependency axis) { float yScale = getAxisRange(axis) / maxYRange; mViewPortHandler.setMinimumScaleY(yScale); }
/** * Sets the size of the area (range on the y-axis) that should be maximum * visible at once. * * @param maxYRange the maximum visible range on the y-axis * @param axis the axis for which this limit should apply */ public void setVisibleYRangeMaximum(float maxYRange, AxisDependency axis) { float yScale = getAxisRange(axis) / maxYRange; mViewPortHandler.setMinimumScaleY(yScale); }
/** * 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); }