posted 16 years ago
Thanks for your solution. My new problem is that,While using MeterPostProcessor , I have increased the BasicStroke of MeterInterval to 20.0f. But in case of display the chord is trimmed at upper level.
I am attaching the code for meter postprocessor for processchart function:
public void processChart (Object chart, Map params) {
MeterPlot plot = (MeterPlot) ((JFreeChart) chart).getPlot();
double min = 0;
double max = 180;
plot.setMeterAngle(180);
plot.setNeedlePaint(Color.BLACK);
plot.setDialBackgroundPaint(Color.white);
plot.setDrawBorder(true);
plot.setDialShape(DialShape.CHORD);
//plot.setDialBackgroundPaint(Color.ORANGE);
plot.setOutlineVisible(true);
plot.setRange(new Range(min, max));
plot.addInterval(new MeterInterval("Normal",new Range(0, 60),Color.green, new BasicStroke(20.0f, BasicStroke.CAP_BUTT, BasicStroke.CAP_BUTT), null));
plot.addInterval(new MeterInterval("Warning",new Range(60, 120),Color.yellow, new BasicStroke(20.0f,BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER), null));
plot.addInterval(new MeterInterval("Critical",new Range(120, 180),Color.red, new BasicStroke(20.0f,BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER), null));
plot.valueToAngle(0.0f);
plot.setUnits("km/h");
}