Example usage for org.jfree.chart ChartPanel restoreAutoRangeBounds

List of usage examples for org.jfree.chart ChartPanel restoreAutoRangeBounds

Introduction

In this page you can find the example usage for org.jfree.chart ChartPanel restoreAutoRangeBounds.

Prototype

public void restoreAutoRangeBounds() 

Source Link

Document

Restores the auto-range calculation on the range axis.

Usage

From source file:net.sf.mzmine.chartbasics.ChartLogics.java

/**
 * Auto range the range axis//from  w  w  w . j  av a2s. c  om
 * 
 * @param myChart
 * @param zoom
 * @param autoRangeY if true the range (Y) axis auto bounds will be restored
 */
public static void autoRangeAxis(ChartPanel myChart) {
    XYPlot plot = (XYPlot) myChart.getChart().getPlot();
    NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
    // trick. Otherwise auto range will fail sometimes
    rangeAxis.setRange(rangeAxis.getRange());
    rangeAxis.setAutoRangeIncludesZero(true);
    myChart.restoreAutoRangeBounds();
}

From source file:com.anrisoftware.prefdialog.miscswing.multichart.freechart.FreechartXYChart.java

@OnAwt
@Override//from ww w.  j  a  v  a2s  . c  om
public void setAutoZoomRange(boolean flag) {
    if (!flag) {
        return;
    }
    ChartPanel panel = this.panel;
    panel.restoreAutoRangeBounds();
    if (rangeAxis != null) {
        chart.getXYPlot().getRangeAxis().setRange(rangeAxis);
    }
}