Example usage for org.jfree.chart.renderer.xy StandardXYItemRenderer setBaseShape

List of usage examples for org.jfree.chart.renderer.xy StandardXYItemRenderer setBaseShape

Introduction

In this page you can find the example usage for org.jfree.chart.renderer.xy StandardXYItemRenderer setBaseShape.

Prototype

public void setBaseShape(Shape shape) 

Source Link

Document

Sets the base shape and sends a RendererChangeEvent to all registered listeners.

Usage

From source file:com.att.aro.ui.view.diagnostictab.CreateBarPlot.java

public XYPlot drawStandardXYPlot(Shape shape, Color color, int minSignal, int maxSignal) {
    // Set up renderer
    StandardXYItemRenderer batteryRenderer = new StandardXYItemRenderer(
            StandardXYItemRenderer.SHAPES_AND_LINES);
    batteryRenderer.setAutoPopulateSeriesShape(false);
    batteryRenderer.setBaseShape(shape);
    batteryRenderer.setSeriesPaint(0, color);

    // Normalize the throughput axis so that it represents max value
    NumberAxis axis = new NumberAxis();
    axis.setVisible(false);/*from  w  w  w .ja v  a 2  s  .c  o  m*/
    axis.setAutoRange(false);
    axis.setRange(minSignal, maxSignal);

    // Create plot
    XYPlot barPlot = new XYPlot(null, null, axis, batteryRenderer);
    barPlot.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT);
    barPlot.getRangeAxis().setVisible(false);

    return barPlot;
}

From source file:com.att.aro.diagnostics.GraphPanel.java

/**
 * Sets up the CPU plot//w  w  w.  j av a 2 s  .c o  m
 * 
 * @return plot CPU plot
 */
private static XYPlot createCpuPlot() {

    // Set up renderer
    StandardXYItemRenderer renderer = new StandardXYItemRenderer(StandardXYItemRenderer.SHAPES_AND_LINES);
    renderer.setAutoPopulateSeriesShape(false);
    renderer.setBaseShape(CPU_PLOT_POINT_SHAPE);
    renderer.setSeriesPaint(0, Color.black);

    // Normalize the throughput axis so that it represents max value
    NumberAxis axis = new NumberAxis();
    axis.setVisible(false);
    axis.setAutoRange(false);
    axis.setRange(MIN_CPU_USAGE, MAX_CPU_USAGE);

    // Create plot
    XYPlot plot = new XYPlot(null, null, axis, renderer);
    plot.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT);
    plot.getRangeAxis().setVisible(false);

    return plot;
}

From source file:com.att.aro.diagnostics.GraphPanel.java

/**
 * Returns a XYPlot for Radio info/*from ww w.j a va2 s .  c  om*/
 * 
 * @return XYPlot.
 */
private static XYPlot createRadioPlot() {

    // Set up renderer
    StandardXYItemRenderer radioRenderer = new StandardXYItemRenderer(StandardXYItemRenderer.SHAPES_AND_LINES);
    radioRenderer.setAutoPopulateSeriesShape(false);
    radioRenderer.setBaseShape(DEFAULT_POINT_SHAPE);
    radioRenderer.setSeriesPaint(0, Color.red);

    // Normalize the throughput axis so that it represents max value
    NumberAxis axis = new NumberAxis();
    axis.setVisible(false);
    axis.setAutoRange(false);
    axis.setRange(MIN_SIGNAL, MAX_SIGNAL);

    // Create plot
    XYPlot radioPlot = new XYPlot(null, null, axis, radioRenderer);
    radioPlot.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT);
    radioPlot.getRangeAxis().setVisible(false);

    return radioPlot;

}

From source file:com.att.aro.diagnostics.GraphPanel.java

/**
 * Returns a XYPlot for Battery Info/*from   w ww.  j  a  v  a 2 s  .c  o m*/
 * 
 * @return XYPlot.
 */
private static XYPlot createBatteryPlot() {

    // Set up renderer
    StandardXYItemRenderer batteryRenderer = new StandardXYItemRenderer(
            StandardXYItemRenderer.SHAPES_AND_LINES);
    batteryRenderer.setAutoPopulateSeriesShape(false);
    batteryRenderer.setBaseShape(DEFAULT_POINT_SHAPE);
    batteryRenderer.setSeriesPaint(0, Color.red);

    // Normalize the throughput axis so that it represents max value
    NumberAxis axis = new NumberAxis();
    axis.setVisible(false);
    axis.setAutoRange(false);
    axis.setRange(0, 110);

    // Create plot
    XYPlot batteryPlot = new XYPlot(null, null, axis, batteryRenderer);
    batteryPlot.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT);
    batteryPlot.getRangeAxis().setVisible(false);

    return batteryPlot;

}