Example usage for org.jfree.chart.plot CategoryPlot setRangeAxis

List of usage examples for org.jfree.chart.plot CategoryPlot setRangeAxis

Introduction

In this page you can find the example usage for org.jfree.chart.plot CategoryPlot setRangeAxis.

Prototype

public void setRangeAxis(int index, ValueAxis axis, boolean notify) 

Source Link

Document

Sets a range axis and, if requested, sends a PlotChangeEvent to all registered listeners.

Usage

From source file:ChartUsingJava.CombinedCategoryPlot.java

/**
 * Sets the range axis that is shared by all the subplots.
 *
 * @param axis  the axis.// ww w.  j  a v  a 2  s . c  o  m
 */
public void setRangeAxis(ValueAxis axis) {
    Iterator l_itr = getSubplots().iterator();
    while (l_itr.hasNext()) {
        CategoryPlot l_subplot = (CategoryPlot) l_itr.next();
        l_subplot.setRangeAxis(0, axis, false);
    }

    super.setRangeAxis(axis);
    if (null == axis) {
        return;
    }

    axis.configure();
}

From source file:ChartUsingJava.CombinedCategoryPlot.java

/**
 * Adds a new subplot with the specified weight.
 *
 * @param subplot  the subplot./*w  w w .j  a va2  s .  co m*/
 * @param weight  the weight for the subplot.
 */
public void add(CategoryPlot subplot, int weight) {
    super.add(subplot, weight);

    ValueAxis l_range = super.getRangeAxis();
    subplot.setRangeAxis(0, l_range, false);

    super.setRangeAxis(l_range);
    if (null == l_range) {
        return;
    }

    l_range.configure();
}