| Auszug |
|---|
|
Nuclos Jasper dial gauge: DialPlot, JFreeChart, image expression, evaluation time report, BufferedImage, Graphics2D. |
Language: Deutsch · English
Dial (gauge) via image object
Dial/gauge display via an image object – JFreeChart DialPlot, evaluation time = report and label limits.
| Status |
|---|
| colour | Blue |
|---|
| title | Application developer |
|---|
|
| Status |
|---|
| colour | Green |
|---|
| title | Updated: Jul 2026 |
|---|
|
| Status |
|---|
| colour | Grey |
|---|
| title | applies to Nuclos 4.2026.x |
|---|
|
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:
- Create a variable with Reset Type = Report (sum over all records).
- Set Evaluation Time = Report on the image – the value is passed to image generation only after the full calculation.
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):
| Codeblock |
|---|
|
Graphics2D g2 = image.createGraphics();
jfreechart.draw(g2, new Rectangle2D.Double(0.0, 0.0, 250, 250));
g2.dispose();
return image; |
| Info |
|---|
|
The dial label does not support \n (line break). For multi-line labels use a second label. |
Related pages
Charts in the designer
Charts.
Open →
Inserting images
Image object.
Open →