@@ -411,15 +411,15 @@ protected void calculateOffsets() {
411411 || mLegend .getPosition () == LegendPosition .BELOW_CHART_CENTER ) {
412412
413413 float yOffset = mLegend .mTextHeightMax ; // It's
414- // possible
415- // that we do
416- // not need
417- // this offset
418- // anymore as
419- // it is
420- // available
421- // through the
422- // extraOffsets
414+ // possible
415+ // that we do
416+ // not need
417+ // this offset
418+ // anymore as
419+ // it is
420+ // available
421+ // through the
422+ // extraOffsets
423423 offsetBottom += Math .min (mLegend .mNeededHeight + yOffset ,
424424 mViewPortHandler .getChartHeight () * mLegend .getMaxSizePercent ());
425425
@@ -636,7 +636,8 @@ public void fitScreen() {
636636 }
637637
638638 /**
639- * Sets the minimum scale value to which can be zoomed out. 1f = fitScreen
639+ * Sets the minimum scale factor value to which can be zoomed out. 1f =
640+ * fitScreen
640641 *
641642 * @param scaleX
642643 * @param scaleY
@@ -648,36 +649,54 @@ public void setScaleMinima(float scaleX, float scaleY) {
648649
649650 /**
650651 * Sets the size of the area (range on the x-axis) that should be maximum
651- * visible at once. If this is e.g. set to 10, no more than 10 values on the
652- * x-axis can be viewed at once without scrolling.
652+ * visible at once (no further zooming out allowed). If this is e.g. set to
653+ * 10, no more than 10 values on the x-axis can be viewed at once without
654+ * scrolling.
653655 *
654- * @param minScaleX
656+ * @param maxXRange The maximum visible range of x-values.
655657 */
656- public void setVisibleXRange (float minScaleX ) {
657- float xScale = mDeltaX / (minScaleX );
658- mViewPortHandler .setMinimumScaleX (minScaleX );
658+ public void setVisibleXRangeMaximum (float maxXRange ) {
659+ float xScale = mDeltaX / (maxXRange );
660+ mViewPortHandler .setMinimumScaleX (xScale );
659661 }
660662
661663 /**
662- * Limits the maximum and minimum value count that can be visible by pinching and zooming.
663- * e.g. minRange=10, maxRange=100 no less than 10 values and no more that 100 values can be viewed
664- * at once without scrolling
664+ * Sets the size of the area (range on the x-axis) that should be minimum
665+ * visible at once (no further zooming in allowed). If this is e.g. set to
666+ * 10, no more than 10 values on the x-axis can be viewed at once without
667+ * scrolling.
668+ *
669+ * @param minXRange The minimum visible range of x-values.
670+ */
671+ public void setVisibleXRangeMinimum (float minXRange ) {
672+ float xScale = mDeltaX / (minXRange );
673+ mViewPortHandler .setMaximumScaleX (xScale );
674+ }
675+
676+ /**
677+ * Limits the maximum and minimum value count that can be visible by
678+ * pinching and zooming. e.g. minRange=10, maxRange=100 no less than 10
679+ * values and no more that 100 values can be viewed at once without
680+ * scrolling
681+ *
682+ * @param minXRange
683+ * @param maxXRange
665684 */
666- public void setVisibleXRange (float minScaleX , float maxScaleX ) {
667- float maxScale = mDeltaX / minScaleX ;
668- float minScale = mDeltaX / maxScaleX ;
669- mViewPortHandler .setScaleXRange ( minScaleX , maxScaleX );
685+ public void setVisibleXRange (float minXRange , float maxXRange ) {
686+ float maxScale = mDeltaX / minXRange ;
687+ float minScale = mDeltaX / maxXRange ;
688+ mViewPortHandler .setMinMaxScaleX ( minScale , maxScale );
670689 }
671690
672691 /**
673692 * Sets the size of the area (range on the y-axis) that should be maximum
674693 * visible at once.
675694 *
676- * @param yRange
695+ * @param maxYRange the maximum visible range on the y-axis
677696 * @param axis - the axis for which this limit should apply
678697 */
679- public void setVisibleYRange (float yRange , AxisDependency axis ) {
680- float yScale = getDeltaY (axis ) / yRange ;
698+ public void setVisibleYRangeMaximum (float maxYRange , AxisDependency axis ) {
699+ float yScale = getDeltaY (axis ) / maxYRange ;
681700 mViewPortHandler .setMinimumScaleY (yScale );
682701 }
683702
0 commit comments