Example usage for org.jfree.chart.plot MeterPlot MeterPlot

List of usage examples for org.jfree.chart.plot MeterPlot MeterPlot

Introduction

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

Prototype

public MeterPlot(ValueDataset dataset) 

Source Link

Document

Creates a new plot that displays the value from the supplied dataset.

Usage

From source file:org.jfree.chart.demo.JFreeChartDemoBase.java

/**
 * Creates and returns a sample meter chart.
 *
 * @return a meter chart./*from ww w  .  j a  v a 2  s.  c  o m*/
 */
public JFreeChart createMeterChartCircle() {

    // create a default chart based on some sample data...
    final String title = this.resources.getString("meter.meter.title");
    final String subtitleStr = this.resources.getString("meter.meter.subtitle");
    //String units = resources.getString("meter.meter.units");
    //DefaultMeterDataset data = DemoDatasetFactory.createMeterDataset();
    final DefaultValueDataset data = new DefaultValueDataset(50.0);
    //data.setUnits(units);
    final MeterPlot plot = new MeterPlot(data);
    plot.setMeterAngle(270);
    plot.setDialShape(DialShape.CIRCLE);
    final JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, false);

    // then customise it a little...
    final TextTitle subtitle = new TextTitle(subtitleStr, new Font("SansSerif", Font.BOLD, 12));
    chart.addSubtitle(subtitle);
    chart.setBackgroundPaint(new GradientPaint(0, 0, Color.white, 0, 1000, Color.blue));
    return chart;
}

From source file:org.jfree.chart.demo.JFreeChartDemoBase.java

/**
 * Creates and returns a sample meter chart.
 *
 * @return a meter chart./* w ww .java2s. c  om*/
 */
public JFreeChart createMeterChartPie() {

    // create a default chart based on some sample data...
    final String title = this.resources.getString("meter.meter.title");
    final String subtitleStr = this.resources.getString("meter.meter.subtitle");
    //String units = resources.getString("meter.meter.units");
    //DefaultMeterDataset data = DemoDatasetFactory.createMeterDataset();
    final DefaultValueDataset data = new DefaultValueDataset(50.0);
    //data.setUnits(units);
    final MeterPlot plot = new MeterPlot(data);
    plot.setMeterAngle(270);
    plot.setDialShape(DialShape.PIE);
    final JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, false);

    // then customise it a little...
    final TextTitle subtitle = new TextTitle(subtitleStr, new Font("SansSerif", Font.BOLD, 12));
    chart.addSubtitle(subtitle);
    chart.setBackgroundPaint(new GradientPaint(0, 0, Color.white, 0, 1000, Color.blue));
    return chart;
}

From source file:org.jfree.chart.demo.JFreeChartDemoBase.java

/**
 * Creates and returns a sample meter chart.
 *
 * @return the meter chart.//from  w  w  w  .ja  v a  2s .  com
 */
public JFreeChart createMeterChartChord() {

    // create a default chart based on some sample data...
    final String title = this.resources.getString("meter.meter.title");
    final String subtitleStr = this.resources.getString("meter.meter.subtitle");
    //String units = resources.getString("meter.meter.units");
    //DefaultMeterDataset data = DemoDatasetFactory.createMeterDataset();
    final DefaultValueDataset data = new DefaultValueDataset(45.0);
    //data.setUnits(units);
    final MeterPlot plot = new MeterPlot(data);
    plot.setMeterAngle(270);
    plot.setDialShape(DialShape.CHORD);
    final JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, false);

    // then customise it a little...
    final TextTitle subtitle = new TextTitle(subtitleStr, new Font("SansSerif", Font.BOLD, 12));
    chart.addSubtitle(subtitle);
    chart.setBackgroundPaint(new GradientPaint(0, 0, Color.white, 0, 1000, Color.blue));
    return chart;
}

From source file:ucar.unidata.idv.flythrough.Flythrough.java

/**
 * _more_//from ww  w .j  av a2  s  . c om
 *
 * @return _more_
 */
public JComponent doMakeDashboardPanel() {
    dashboardImage = GuiUtils.getImage("/auxdata/ui/icons/cockpit.gif", getClass(), false);
    pipPanel = new PipPanel(viewManager);
    pipPanel.getNavigatedPanel().setBorder(null);
    pipPanel.setPreferredSize(new Dimension(100, 100));
    pipPanel.doLayout();
    pipPanel.validate();
    pipFrame = new JFrame("Show remain invisible");
    pipFrame.setContentPane(pipPanel);
    pipFrame.pack();

    dashboardLbl = new JLabel(new ImageIcon(dashboardImage)) {
        public void paint(Graphics g) {
            //                readPts();
            paintDashboardBackground(g, dashboardLbl);
            super.paint(g);
            paintDashboardAfter(g, dashboardLbl);
        }
    };
    dashboardLbl.addKeyListener(new KeyAdapter() {
        public void keyPressed(KeyEvent e) {
            pipPanel.keyPressedInMap(e);
            updateDashboard();
        }
    });

    dashboardLbl.setVerticalAlignment(SwingConstants.BOTTOM);
    MouseAdapter mouseAdapter = new MouseAdapter() {
        Point mouseStart = new Point(0, 0);
        Point originalOffset = new Point(0, 0);

        public void mouseClicked(MouseEvent me) {
            if (pipRect == null) {
                return;
            }
            if (goToClick && pipRect.contains(new Point(me.getX(), me.getY()))) {
                try {
                    int x = me.getX() - pipRect.x;
                    int y = me.getY() - pipRect.y;
                    //                        System.err.println ("x:" + x +" y:" + y);
                    LatLonPoint llp = pipPanel.screenToLatLon(x, y);
                    location = makePoint(llp.getLatitude(), llp.getLongitude(), 0);
                    doDrive(false, heading);
                } catch (Exception exc) {
                    logException("Driving", exc);
                }
            }
        }

        public void mousePressed(MouseEvent me) {
            dashboardLbl.requestFocus();
            originalOffset = new Point(dashboardImageOffset);
            mouseStart.x = me.getX();
            mouseStart.y = me.getY();
            Rectangle b = dashboardLbl.getBounds();
            int w = dashboardImage.getWidth(null);
            int h = dashboardImage.getHeight(null);
            Point ul = new Point(b.width / 2 - w / 2, b.height - h);
            //                System.out.println("{" + (me.getX()-ul.x) +",  " + (me.getY()-ul.y)+"}");
        }

        public void mouseDragged(MouseEvent me) {
            dashboardImageOffset.x = originalOffset.x + me.getX() - mouseStart.x;
            dashboardImageOffset.y = originalOffset.y + me.getY() - mouseStart.y;
            updateDashboard();
        }
    };

    dashboardLbl.addMouseListener(mouseAdapter);
    dashboardLbl.addMouseMotionListener(mouseAdapter);

    //Create ome charts to force classloading (which takes some time) in a thread
    //So the gui shows quicker
    Misc.run(new Runnable() {
        public void run() {
            try {
                MeterPlot plot = new MeterPlot(new DefaultValueDataset(new Double(1)));
                createChart(new XYSeriesCollection());
            } catch (Exception ignore) {
            }
        }
    });

    return dashboardLbl;
}

From source file:net.sf.fspdfs.chartthemes.spring.GenericChartTheme.java

/**
 * Build and configure a meter chart.//from  ww  w.j a  va  2  s  . c o m
 *
 * @param evaluation current expression evaluation phase
 * @throws JRException
*/
protected JFreeChart createMeterChart() throws JRException {
    // Start by creating the plot that will hold the meter
    MeterPlot chartPlot = new MeterPlot((ValueDataset) getDataset());
    JRMeterPlot jrPlot = (JRMeterPlot) getPlot();

    // Set the shape
    MeterShapeEnum shape = jrPlot.getShapeValue() == null ? MeterShapeEnum.PIE : jrPlot.getShapeValue();

    switch (shape) {
    case CHORD:
        chartPlot.setDialShape(DialShape.CHORD);
        break;
    case CIRCLE:
        chartPlot.setDialShape(DialShape.CIRCLE);
        break;
    case DIAL:
        return createDialChart();
    case PIE:
    default:
        chartPlot.setDialShape(DialShape.PIE);
    }

    // Set the meter's range
    chartPlot.setRange(convertRange(jrPlot.getDataRange()));

    // Set the size of the meter
    int meterAngle = jrPlot.getMeterAngleInteger() == null ? 180 : jrPlot.getMeterAngleInteger().intValue();
    chartPlot.setMeterAngle(meterAngle);

    // Set the units - this is just a string that will be shown next to the
    // value
    String units = jrPlot.getUnits();
    if (units != null && units.length() > 0)
        chartPlot.setUnits(units);

    // Set the spacing between ticks.  I hate the name "tickSize" since to me it
    // implies I am changing the size of the tick, not the spacing between them.
    double tickInterval = jrPlot.getTickIntervalDouble() == null ? 10.0
            : jrPlot.getTickIntervalDouble().doubleValue();
    chartPlot.setTickSize(tickInterval);

    // Set all the colors we support
    Color color = jrPlot.getMeterBackgroundColor();
    if (color != null)
        chartPlot.setDialBackgroundPaint(color);

    color = jrPlot.getNeedleColor();
    if (color != null)
        chartPlot.setNeedlePaint(color);

    JRFont tickLabelFont = jrPlot.getTickLabelFont();
    Integer defaultBaseFontSize = (Integer) getDefaultValue(defaultChartPropertiesMap,
            ChartThemesConstants.BASEFONT_SIZE);
    Font themeTickLabelFont = getFont(
            (JRFont) getDefaultValue(defaultPlotPropertiesMap, ChartThemesConstants.PLOT_TICK_LABEL_FONT),
            tickLabelFont, defaultBaseFontSize);
    chartPlot.setTickLabelFont(themeTickLabelFont);

    JRValueDisplay display = jrPlot.getValueDisplay();
    JRFont displayFont = display.getFont();
    Font themeDisplayFont = getFont(
            (JRFont) getDefaultValue(defaultPlotPropertiesMap, ChartThemesConstants.PLOT_DISPLAY_FONT),
            displayFont, defaultBaseFontSize);
    // Set how the value is displayed.
    if (display != null) {
        if (display.getColor() != null) {
            chartPlot.setValuePaint(display.getColor());
        }

        if (display.getMask() != null) {
            chartPlot.setTickLabelFormat(new DecimalFormat(display.getMask()));
        }
        if (display.getFont() != null) {
            chartPlot.setValueFont(themeDisplayFont);
        }

    }

    color = jrPlot.getTickColor();
    if (color != null)
        chartPlot.setTickPaint(color);

    // Now define all of the intervals, setting their range and color
    List intervals = jrPlot.getIntervals();
    if (intervals != null) {
        Iterator iter = intervals.iterator();
        while (iter.hasNext()) {
            JRMeterInterval interval = (JRMeterInterval) iter.next();
            if (interval != null)
                chartPlot.addInterval(convertInterval(interval));
        }
    }

    // Actually create the chart around the plot
    JFreeChart jfreeChart = new JFreeChart((String) evaluateExpression(getChart().getTitleExpression()), null,
            chartPlot, isShowLegend());

    // Set all the generic options
    configureChart(jfreeChart, getPlot());

    return jfreeChart;
}

From source file:net.sf.fspdfs.chartthemes.simple.SimpleChartTheme.java

/**
 * Build and configure a meter chart./* w w w  . j  a v a2 s  . c  o m*/
 *
 * @param evaluation current expression evaluation phase
 * @throws JRException
*/
protected JFreeChart createMeterChart() throws JRException {
    JRMeterPlot jrPlot = (JRMeterPlot) getPlot();

    // Start by creating the plot that will hold the meter
    MeterPlot chartPlot = new MeterPlot((ValueDataset) getDataset());

    // Set the shape
    MeterShapeEnum shape = jrPlot.getShapeValue() == null ? MeterShapeEnum.PIE : jrPlot.getShapeValue();
    if (shape == MeterShapeEnum.CHORD)
        chartPlot.setDialShape(DialShape.CHORD);
    else if (shape == MeterShapeEnum.CIRCLE)
        chartPlot.setDialShape(DialShape.CIRCLE);
    else if (shape == MeterShapeEnum.DIAL)
        return createDialChart();
    else
        chartPlot.setDialShape(DialShape.PIE);

    // Set the meter's range
    chartPlot.setRange(convertRange(jrPlot.getDataRange()));

    // Set the size of the meter
    int meterAngle = jrPlot.getMeterAngleInteger() == null ? 180 : jrPlot.getMeterAngleInteger().intValue();
    chartPlot.setMeterAngle(meterAngle);

    // Set the units - this is just a string that will be shown next to the
    // value
    String units = jrPlot.getUnits();
    if (units != null && units.length() > 0)
        chartPlot.setUnits(units);

    // Set the spacing between ticks.  I hate the name "tickSize" since to me it
    // implies I am changing the size of the tick, not the spacing between them.
    double tickInterval = jrPlot.getTickIntervalDouble() == null ? 10.0
            : jrPlot.getTickIntervalDouble().doubleValue();
    chartPlot.setTickSize(tickInterval);

    // Set all the colors we support
    Color color = jrPlot.getMeterBackgroundColor();
    if (color != null)
        chartPlot.setDialBackgroundPaint(color);

    color = jrPlot.getNeedleColor();
    if (color != null)
        chartPlot.setNeedlePaint(color);

    JRBaseFont font = new JRBaseFont();
    JRFontUtil.copyNonNullOwnProperties(getPlotSettings().getTickLabelFont(), font);
    JRFontUtil.copyNonNullOwnProperties(jrPlot.getTickLabelFont(), font);
    font = new JRBaseFont(getChart(), font);
    chartPlot.setTickLabelFont(JRFontUtil.getAwtFont(font, getLocale()));

    // Set how the value is displayed.
    JRValueDisplay display = jrPlot.getValueDisplay();
    if (display != null) {
        if (display.getColor() != null) {
            chartPlot.setValuePaint(display.getColor());
        }

        if (display.getMask() != null) {
            chartPlot.setTickLabelFormat(new DecimalFormat(display.getMask()));
        }

        font = new JRBaseFont();
        JRFontUtil.copyNonNullOwnProperties(getPlotSettings().getDisplayFont(), font);
        JRFontUtil.copyNonNullOwnProperties(jrPlot.getValueDisplay().getFont(), font);
        font = new JRBaseFont(getChart(), font);
        chartPlot.setValueFont(JRFontUtil.getAwtFont(font, getLocale()));

    }

    color = jrPlot.getTickColor();
    if (color != null)
        chartPlot.setTickPaint(color);

    // Now define all of the intervals, setting their range and color
    List intervals = jrPlot.getIntervals();
    if (intervals != null) {
        Iterator iter = intervals.iterator();
        while (iter.hasNext()) {
            JRMeterInterval interval = (JRMeterInterval) iter.next();
            if (interval != null)
                chartPlot.addInterval(convertInterval(interval));
        }
    }

    // Actually create the chart around the plot
    JFreeChart jfreeChart = new JFreeChart((String) evaluateExpression(getChart().getTitleExpression()), null,
            chartPlot, isShowLegend());

    // Set all the generic options
    configureChart(jfreeChart, getPlot());

    return jfreeChart;
}

From source file:net.sf.jasperreports.chartthemes.spring.GenericChartTheme.java

/**
 * Build and configure a meter chart./*w  w w  .ja  va2s. co  m*/
 */
protected JFreeChart createMeterChart() throws JRException {
    // Start by creating the plot that will hold the meter
    MeterPlot chartPlot = new MeterPlot((ValueDataset) getDataset());
    JRMeterPlot jrPlot = (JRMeterPlot) getPlot();

    // Set the shape
    MeterShapeEnum shape = jrPlot.getShapeValue() == null ? MeterShapeEnum.PIE : jrPlot.getShapeValue();

    switch (shape) {
    case CHORD:
        chartPlot.setDialShape(DialShape.CHORD);
        break;
    case CIRCLE:
        chartPlot.setDialShape(DialShape.CIRCLE);
        break;
    case DIAL:
        return createDialChart();
    case PIE:
    default:
        chartPlot.setDialShape(DialShape.PIE);
    }

    // Set the meter's range
    chartPlot.setRange(convertRange(jrPlot.getDataRange()));

    // Set the size of the meter
    int meterAngle = jrPlot.getMeterAngleInteger() == null ? 180 : jrPlot.getMeterAngleInteger();
    chartPlot.setMeterAngle(meterAngle);

    // Set the units - this is just a string that will be shown next to the
    // value
    String units = jrPlot.getUnits();
    if (units != null && units.length() > 0)
        chartPlot.setUnits(units);

    // Set the spacing between ticks.  I hate the name "tickSize" since to me it
    // implies I am changing the size of the tick, not the spacing between them.
    double tickInterval = jrPlot.getTickIntervalDouble() == null ? 10.0 : jrPlot.getTickIntervalDouble();
    chartPlot.setTickSize(tickInterval);

    // Set all the colors we support
    Color color = jrPlot.getMeterBackgroundColor();
    if (color != null)
        chartPlot.setDialBackgroundPaint(color);

    color = jrPlot.getNeedleColor();
    if (color != null)
        chartPlot.setNeedlePaint(color);

    JRFont tickLabelFont = jrPlot.getTickLabelFont();
    Integer defaultBaseFontSize = (Integer) getDefaultValue(defaultChartPropertiesMap,
            ChartThemesConstants.BASEFONT_SIZE);
    Font themeTickLabelFont = getFont(
            (JRFont) getDefaultValue(defaultPlotPropertiesMap, ChartThemesConstants.PLOT_TICK_LABEL_FONT),
            tickLabelFont, defaultBaseFontSize);
    chartPlot.setTickLabelFont(themeTickLabelFont);

    // localizing the default format, can be overridden by display.getMask()
    chartPlot.setTickLabelFormat(NumberFormat.getInstance(getLocale()));

    JRValueDisplay display = jrPlot.getValueDisplay();
    JRFont displayFont = display.getFont();
    Font themeDisplayFont = getFont(
            (JRFont) getDefaultValue(defaultPlotPropertiesMap, ChartThemesConstants.PLOT_DISPLAY_FONT),
            displayFont, defaultBaseFontSize);
    // Set how the value is displayed.
    if (display != null) {
        if (display.getColor() != null) {
            chartPlot.setValuePaint(display.getColor());
        }

        if (display.getMask() != null) {
            chartPlot.setTickLabelFormat(
                    new DecimalFormat(display.getMask(), DecimalFormatSymbols.getInstance(getLocale())));
        }
        if (display.getFont() != null) {
            chartPlot.setValueFont(themeDisplayFont);
        }

    }

    color = jrPlot.getTickColor();
    if (color != null)
        chartPlot.setTickPaint(color);

    // Now define all of the intervals, setting their range and color
    List<JRMeterInterval> intervals = jrPlot.getIntervals();
    if (intervals != null) {
        Iterator<JRMeterInterval> iter = intervals.iterator();
        while (iter.hasNext()) {
            JRMeterInterval interval = iter.next();
            if (interval != null)
                chartPlot.addInterval(convertInterval(interval));
        }
    }

    // Actually create the chart around the plot
    JFreeChart jfreeChart = new JFreeChart(evaluateTextExpression(getChart().getTitleExpression()), null,
            chartPlot, isShowLegend());

    // Set all the generic options
    configureChart(jfreeChart, getPlot());

    return jfreeChart;
}

From source file:net.sf.jasperreports.chartthemes.simple.SimpleChartTheme.java

/**
 * Build and configure a meter chart./* www  .  ja  v a2s .  co  m*/
 */
protected JFreeChart createMeterChart() throws JRException {
    JRMeterPlot jrPlot = (JRMeterPlot) getPlot();

    // Start by creating the plot that will hold the meter
    MeterPlot chartPlot = new MeterPlot((ValueDataset) getDataset());

    // Set the shape
    MeterShapeEnum shape = jrPlot.getShapeValue() == null ? MeterShapeEnum.PIE : jrPlot.getShapeValue();
    if (shape == MeterShapeEnum.CHORD)
        chartPlot.setDialShape(DialShape.CHORD);
    else if (shape == MeterShapeEnum.CIRCLE)
        chartPlot.setDialShape(DialShape.CIRCLE);
    else if (shape == MeterShapeEnum.DIAL)
        return createDialChart();
    else
        chartPlot.setDialShape(DialShape.PIE);

    // Set the meter's range
    chartPlot.setRange(convertRange(jrPlot.getDataRange()));

    // Set the size of the meter
    int meterAngle = jrPlot.getMeterAngleInteger() == null ? 180 : jrPlot.getMeterAngleInteger();
    chartPlot.setMeterAngle(meterAngle);

    // Set the units - this is just a string that will be shown next to the
    // value
    String units = jrPlot.getUnits();
    if (units != null && units.length() > 0)
        chartPlot.setUnits(units);

    // Set the spacing between ticks.  I hate the name "tickSize" since to me it
    // implies I am changing the size of the tick, not the spacing between them.
    double tickInterval = jrPlot.getTickIntervalDouble() == null ? 10.0 : jrPlot.getTickIntervalDouble();
    chartPlot.setTickSize(tickInterval);

    // Set all the colors we support
    Color color = jrPlot.getMeterBackgroundColor();
    if (color != null)
        chartPlot.setDialBackgroundPaint(color);

    color = jrPlot.getNeedleColor();
    if (color != null)
        chartPlot.setNeedlePaint(color);

    JRBaseFont font = new JRBaseFont();
    FontUtil.copyNonNullOwnProperties(getPlotSettings().getTickLabelFont(), font);
    FontUtil.copyNonNullOwnProperties(jrPlot.getTickLabelFont(), font);
    font = new JRBaseFont(getChart(), font);
    chartPlot.setTickLabelFont(getFontUtil().getAwtFont(font, getLocale()));

    // localizing the default format, can be overridden by display.getMask()
    chartPlot.setTickLabelFormat(NumberFormat.getInstance(getLocale()));

    // Set how the value is displayed.
    JRValueDisplay display = jrPlot.getValueDisplay();
    if (display != null) {
        if (display.getColor() != null) {
            chartPlot.setValuePaint(display.getColor());
        }

        if (display.getMask() != null) {
            chartPlot.setTickLabelFormat(
                    new DecimalFormat(display.getMask(), DecimalFormatSymbols.getInstance(getLocale())));
        }

        font = new JRBaseFont();
        FontUtil.copyNonNullOwnProperties(getPlotSettings().getDisplayFont(), font);
        FontUtil.copyNonNullOwnProperties(jrPlot.getValueDisplay().getFont(), font);
        font = new JRBaseFont(getChart(), font);
        chartPlot.setValueFont(getFontUtil().getAwtFont(font, getLocale()));

    }

    color = jrPlot.getTickColor();
    if (color != null)
        chartPlot.setTickPaint(color);

    // Now define all of the intervals, setting their range and color
    List<JRMeterInterval> intervals = jrPlot.getIntervals();
    if (intervals != null) {
        Iterator<JRMeterInterval> iter = intervals.iterator();
        while (iter.hasNext()) {
            JRMeterInterval interval = iter.next();
            if (interval != null)
                chartPlot.addInterval(convertInterval(interval));
        }
    }

    // Actually create the chart around the plot
    JFreeChart jfreeChart = new JFreeChart(evaluateTextExpression(getChart().getTitleExpression()), null,
            chartPlot, isShowLegend());

    // Set all the generic options
    configureChart(jfreeChart, getPlot());

    return jfreeChart;
}

From source file:hpssim.grafica.HPSsim.java

private JFreeChart createChart(ValueDataset valuedataset, String name) {
    MeterPlot meterplot = new MeterPlot(valuedataset);
    meterplot.addInterval(new MeterInterval("High", new Range(80D, 100D)));
    meterplot.setDialOutlinePaint(Color.white);

    JFreeChart jfreechart = new JFreeChart(name, JFreeChart.DEFAULT_TITLE_FONT, meterplot, false);
    return jfreechart;
}

From source file:net.sf.jasperreports.engine.fill.DefaultChartTheme.java

/**
 *
 *///from   www .  ja  v  a2s . c  o  m
protected JFreeChart createMeterChart() throws JRException {
    JRMeterPlot jrPlot = (JRMeterPlot) getPlot();

    // Start by creating the plot that will hold the meter
    MeterPlot chartPlot = new MeterPlot((ValueDataset) getDataset());

    // Set the shape
    MeterShapeEnum shape = jrPlot.getShapeValue() == null ? MeterShapeEnum.PIE : jrPlot.getShapeValue();
    switch (shape) {
    case CHORD:
        chartPlot.setDialShape(DialShape.CHORD);
        break;
    case CIRCLE:
        chartPlot.setDialShape(DialShape.CIRCLE);
        break;
    case PIE:
    default:
        chartPlot.setDialShape(DialShape.PIE);
    }

    // Set the meter's range
    chartPlot.setRange(convertRange(jrPlot.getDataRange()));

    // Set the size of the meter
    int meterAngle = jrPlot.getMeterAngleInteger() == null ? 180 : jrPlot.getMeterAngleInteger();
    chartPlot.setMeterAngle(meterAngle);

    // Set the units - this is just a string that will be shown next to the
    // value
    String units = jrPlot.getUnits();
    if (units != null && units.length() > 0) {
        chartPlot.setUnits(units);
    }

    // Set the font used for tick labels
    if (jrPlot.getTickLabelFont() != null) {
        chartPlot.setTickLabelFont(fontUtil.getAwtFont(jrPlot.getTickLabelFont(), getLocale()));
    }

    // Set the spacing between ticks.  I hate the name "tickSize" since to me it
    // implies I am changing the size of the tick, not the spacing between them.
    double tickInterval = jrPlot.getTickIntervalDouble() == null ? 10.0 : jrPlot.getTickIntervalDouble();
    chartPlot.setTickSize(tickInterval);

    // Set all the colors we support
    Color color = jrPlot.getMeterBackgroundColor();
    if (color != null) {
        chartPlot.setDialBackgroundPaint(color);
    }

    color = jrPlot.getNeedleColor();
    if (color != null) {
        chartPlot.setNeedlePaint(color);
    }

    // localizing the default format, can be overridden by display.getMask()
    chartPlot.setTickLabelFormat(NumberFormat.getInstance(getLocale()));

    // Set how the value is displayed.
    JRValueDisplay display = jrPlot.getValueDisplay();
    if (display != null) {
        if (display.getColor() != null) {
            chartPlot.setValuePaint(display.getColor());
        }

        if (display.getMask() != null) {
            chartPlot.setTickLabelFormat(
                    new DecimalFormat(display.getMask(), DecimalFormatSymbols.getInstance(getLocale())));
        }

        if (display.getFont() != null) {
            chartPlot.setValueFont(fontUtil.getAwtFont(display.getFont(), getLocale()));
        }

    }

    color = jrPlot.getTickColor();
    if (color != null) {
        chartPlot.setTickPaint(color);
    }

    // Now define all of the intervals, setting their range and color
    List<JRMeterInterval> intervals = jrPlot.getIntervals();
    if (intervals != null) {
        Iterator<JRMeterInterval> iter = intervals.iterator();
        while (iter.hasNext()) {
            JRMeterInterval interval = iter.next();
            chartPlot.addInterval(convertInterval(interval));
        }
    }

    // Actually create the chart around the plot
    JFreeChart jfreeChart = new JFreeChart(evaluateTextExpression(getChart().getTitleExpression()), null,
            chartPlot, isShowLegend());

    // Set all the generic options
    configureChart(jfreeChart);

    return jfreeChart;
}