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

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

Introduction

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

Prototype

public void setRangeAxis(ValueAxis axis) 

Source Link

Document

Sets the range axis for the plot and sends a PlotChangeEvent to all registered listeners.

Usage

From source file:org.sonar.plugins.ral.GaugeChart.java

@Override
protected Plot getPlot(ChartParameters params) {
    ThermometerPlot plot = new ThermometerPlot(createDataset(params));

    plot.setGap(1);/*from w  ww .ja v a2  s .c  o  m*/

    plot.setRange(0, 1);
    plot.setSubrange(0, 0, 1);

    plot.setSubrangePaint(0, Color.decode("#ffffff"));
    plot.setSubrangePaint(1, Color.decode("#ffffff"));
    plot.setSubrangePaint(2, Color.decode("#ffffff"));

    plot.setMercuryPaint(Color.decode("#dddddd"));
    plot.setThermometerPaint(Color.decode("#aaaaaa"));
    plot.setValuePaint(Color.decode("#333333"));

    plot.setUseSubrangePaint(false);
    plot.setUnits(ThermometerPlot.UNITS_NONE);
    plot.setBulbRadius(15);
    plot.setColumnRadius(6);

    NumberAxis axis = new NumberAxis();
    axis.setNumberFormatOverride(NumberFormat.getPercentInstance());
    plot.setRangeAxis(axis);
    plot.setValueLocation(ThermometerPlot.NONE);

    return plot;
}