DialPlot plot = new DialPlot();
plot.setDataset((ValueDataset)dataset);
plot.setDialFrame(new StandardDialFrame());
plot.setBackground(new DialBackground());
if(dialtextuse){
DialTextAnnotation annotation1 = new DialTextAnnotation(dialtext);
annotation1.setFont(styleTitle.getFont());
annotation1.setRadius(0.7);
plot.addLayer(annotation1);
}
DialValueIndicator dvi = new DialValueIndicator(0);
dvi.setFont(new Font(labelsValueStyle.getFontName(), Font.PLAIN, labelsValueStyle.getSize()));
dvi.setPaint(labelsValueStyle.getColor());
plot.addLayer(dvi);
StandardDialScale scale = new StandardDialScale(lower,
upper, -120, -300, 10.0, 4);
if (!( increment > 0)){
logger.warn("increment cannot be less than 0, put default to 0.1");
increment = 0.01;
}
scale.setMajorTickIncrement(increment);
// if (!( minorTickCount > 0)){
// logger.warn("minor tick count cannot be less than 0, put default to 1");
// minorTickCount = 1;
// }
scale.setMinorTickCount(minorTickCount);
scale.setTickRadius(0.88);
scale.setTickLabelOffset(0.15);
//set tick label style
Font tickLabelsFont = new Font(labelsTickStyle.getFontName(), Font.PLAIN, labelsTickStyle.getSize());
scale.setTickLabelFont(tickLabelsFont);
scale.setTickLabelPaint(labelsTickStyle.getColor());
plot.addScale(0, scale);
plot.addPointer(new DialPointer.Pin());
DialCap cap = new DialCap();
plot.setCap(cap);
// sets intervals
for (Iterator iterator = intervals.iterator(); iterator.hasNext();) {
KpiInterval interval = (KpiInterval) iterator.next();
StandardDialRange range = new StandardDialRange(interval.getMin(), interval.getMax(),
interval.getColor());
range.setInnerRadius(0.52);
range.setOuterRadius(0.55);
plot.addLayer(range);
}
GradientPaint gp = new GradientPaint(new Point(),
new Color(255, 255, 255), new Point(),
new Color(170, 170, 220));
DialBackground db = new DialBackground(gp);
db.setGradientPaintTransformer(new StandardGradientPaintTransformer(
GradientPaintTransformType.VERTICAL));
plot.setBackground(db);
plot.removePointer(0);
DialPointer.Pointer p = new DialPointer.Pointer();