Example usage for org.jfree.chart ChartPanel restoreAutoDomainBounds

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

Introduction

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

Prototype

public void restoreAutoDomainBounds() 

Source Link

Document

Restores the auto-range calculation on the domain axis.

Usage

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

/**
 * Auto range the range axis//  ww w .j ava 2 s.  c  o m
 * 
 * @param myChart
 * @param zoom
 * @param autoRangeY if true the range (Y) axis auto bounds will be restored
 */
public static void autoDomainAxis(ChartPanel myChart) {
    XYPlot plot = (XYPlot) myChart.getChart().getPlot();
    NumberAxis axis = (NumberAxis) plot.getDomainAxis();
    // trick. Otherwise auto range will fail sometimes
    axis.setRange(axis.getRange());
    axis.setAutoRangeIncludesZero(false);
    myChart.restoreAutoDomainBounds();
}

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

@OnAwt
@Override/*from   w w w  .  j  a va 2s.com*/
public void setAutoZoomDomain(boolean flag) {
    if (!flag) {
        return;
    }
    ChartModel model = getModel();
    ChartPanel panel = this.panel;
    panel.restoreAutoDomainBounds();
    int size = model == null ? 0 : model.getRowCount();
    size = min(size / 4, maximumView);
    setViewMaximum(size);
}