Example usage for org.jfree.chart.axis ValueAxis zoomRange

List of usage examples for org.jfree.chart.axis ValueAxis zoomRange

Introduction

In this page you can find the example usage for org.jfree.chart.axis ValueAxis zoomRange.

Prototype

public void zoomRange(double lowerPercent, double upperPercent) 

Source Link

Document

Zooms in on the current range.

Usage

From source file:com.rapidminer.gui.new_plotter.engine.jfreechart.link_and_brush.plots.LinkAndBrushCategoryPlot.java

@Override
public List<Pair<Integer, Range>> calculateRangeAxesZoom(double lowerPercent, double upperPercent,
        PlotRenderingInfo info, Point2D source, boolean zoomIn) {

    List<Pair<Integer, Range>> newRanges = new LinkedList<Pair<Integer, Range>>();

    for (int i = 0; i < getRangeAxisCount(); i++) {
        ValueAxis rangeAxis = getRangeAxis(i);
        if (rangeAxis != null) {
            if (rangeAxis instanceof LinkAndBrushAxis) {
                Range calculateZoomRange = ((LinkAndBrushAxis) rangeAxis).calculateZoomRange(lowerPercent,
                        upperPercent, zoomIn);
                newRanges.add(new Pair<Integer, Range>(i, calculateZoomRange));
            } else if (zoomIn) {
                rangeAxis.zoomRange(lowerPercent, upperPercent);
            }/*from  ww w  .  j  a v  a  2s .c  om*/
        }
    }

    return newRanges;
}

From source file:com.rapidminer.gui.new_plotter.engine.jfreechart.link_and_brush.plots.LinkAndBrushXYPlot.java

@Override
public List<Pair<Integer, Range>> calculateDomainAxesZoom(double lowerPercent, double upperPercent,
        boolean zoomIn) {

    List<Pair<Integer, Range>> newRanges = new LinkedList<Pair<Integer, Range>>();

    for (int i = 0; i < getDomainAxisCount(); i++) {
        ValueAxis domainAxis = getDomainAxis(i);
        if (domainAxis != null) {
            if (domainAxis instanceof LinkAndBrushAxis) {
                Range calculateZoomRange = ((LinkAndBrushAxis) domainAxis).calculateZoomRange(lowerPercent,
                        upperPercent, zoomIn);
                newRanges.add(new Pair<Integer, Range>(i, calculateZoomRange));
            } else if (zoomIn) {
                domainAxis.zoomRange(lowerPercent, upperPercent);
            }/*  www  .  jav  a 2  s.co m*/
        }
    }

    return newRanges;
}

From source file:ucar.unidata.idv.control.chart.MyXYPlot.java

/**
 * Zooms in on the range axes./*ww w .  j  a v  a2s  . c om*/
 *
 * @param lowerPercent  the lower bound.
 * @param upperPercent  the upper bound.
 * @param info  the plot rendering info.
 * @param source  the source point.
 */
public void zoomRangeAxes(double lowerPercent, double upperPercent, PlotRenderingInfo info, Point2D source) {
    for (int i = 0; i < this.rangeAxes.size(); i++) {
        ValueAxis rangeAxis = (ValueAxis) this.rangeAxes.get(i);
        if (rangeAxis != null) {
            rangeAxis.zoomRange(lowerPercent, upperPercent);
        }
    }
}

From source file:ucar.unidata.idv.control.chart.MyXYPlot.java

/**
 * Zooms in on the domain axis/axes.  The new lower and upper bounds are
 * specified as percentages of the current axis range, where 0 percent is
 * the current lower bound and 100 percent is the current upper bound.
 *
 * @param lowerPercent  a percentage that determines the new lower bound
 *                      for the axis (e.g. 0.20 is twenty percent).
 * @param upperPercent  a percentage that determines the new upper bound
 *                      for the axis (e.g. 0.80 is eighty percent).
 * @param info  the plot rendering info.
 * @param source  the source point.//w w  w  .j a v a  2s.com
 */
public void zoomDomainAxes(double lowerPercent, double upperPercent, PlotRenderingInfo info, Point2D source) {
    for (int i = 0; i < this.domainAxes.size(); i++) {
        ValueAxis domainAxis = (ValueAxis) this.domainAxes.get(i);
        if (domainAxis != null) {
            domainAxis.zoomRange(lowerPercent, upperPercent);
        }
    }
}