Example usage for org.jfree.chart.plot.dial DialValueIndicator DialValueIndicator

List of usage examples for org.jfree.chart.plot.dial DialValueIndicator DialValueIndicator

Introduction

In this page you can find the example usage for org.jfree.chart.plot.dial DialValueIndicator DialValueIndicator.

Prototype

public DialValueIndicator() 

Source Link

Document

Creates a new instance of DialValueIndicator.

Usage

From source file:org.rdv.viz.dial.DialPanel.java

/**
 * Creates the panel containing the dial.
 * //from www .java  2s.  c  om
 * @return  the dial panel
 */
private JPanel createDialPanel() {
    plot = new DialPlot(dataset);

    plot.setDialFrame(new StandardDialFrame());

    engineeringFormat = new EngineeringFormat();
    engineeringFormatWithUnit = new EngineeringFormat();

    dialValueIndicator = new DialValueIndicator();
    dialValueIndicator.setOutlinePaint(Color.black);
    dialValueIndicator.setRadius(0.7);
    dialValueIndicator.setVisible(false);
    dialValueIndicator.setNumberFormat(engineeringFormatWithUnit);
    plot.addLayer(dialValueIndicator);

    dialTextAnnotation = new DialTextAnnotation("");
    dialTextAnnotation.setRadius(0.8);
    plot.addLayer(dialTextAnnotation);

    DialPointer dialPointer = new DialPointer.Pointer();
    dialPointer.setRadius(0.9);
    plot.addPointer(dialPointer);

    plot.setCap(new DialCap());

    dialScale = new BoundedDialScale();
    dialScale.setStartAngle(-120);
    dialScale.setExtent(-300);
    dialScale.setMinorTickCount(5);
    dialScale.setTickLabelFormatter(engineeringFormat);
    dialScale.setTickRadius(0.9);

    JFreeChart chart = new JFreeChart(plot);
    chart.removeLegend();

    return new ChartPanel(chart);
}