Nuclos Jasper dial gauge: DialPlot, JFreeChart, image expression, evaluation time report, BufferedImage, Graphics2D.

globe with meridians Language: Deutsch · English

hammer and wrench Dial (gauge) via image object

Dial/gauge display via an image object – JFreeChart DialPlot, evaluation time = report and label limits.

Auf dieser Seite

A dial (gauge) cannot be shown as a standard chart but via an image object whose picture is drawn by a JFreeChart DialPlot (based on DialDemo2.java).

Summing the value correctly

To output a sum over a variable:

Implementation

A scriptlet/customizer class turns the value into a java.awt.Image: it builds a DialPlot with scale, needle and cap, wraps it in a JFreeChart and draws it via Graphics2D into a BufferedImage (e.g. 250×250 px):

Graphics2D g2 = image.createGraphics();
jfreechart.draw(g2, new Rectangle2D.Double(0.0, 0.0, 250, 250));
g2.dispose();
return image;

The dial label does not support \n (line break). For multi-line labels use a second label.

Related pages

bar chart Charts in the designer


Charts.

Öffnen →

open book Inserting images


Image object.

Öffnen →