// get data for diagrams
logger.debug("IN");
Dataset dataset=(Dataset)datasets.getDatasets().get("1");
DialPlot plot = new DialPlot();
plot.setDataset((ValueDataset)dataset);
ArcDialFrame dialFrame=null;
if(!horizontalView){
plot.setView(0.78, 0.37, 0.22, 0.26);
dialFrame = new ArcDialFrame(-10.0, 20.0);
}
else{
plot.setView(0.21, 0.0, 0.58, 0.30);
dialFrame = new ArcDialFrame(60.0, 60.0);
}
dialFrame.setInnerRadius(0.65);
dialFrame.setOuterRadius(0.90);
dialFrame.setForegroundPaint(Color.darkGray);
dialFrame.setStroke(new BasicStroke(3.0f));
plot.setDialFrame(dialFrame);
GradientPaint gp = new GradientPaint(new Point(),
new Color(255, 255, 255), new Point(),
new Color(240, 240, 240));
DialBackground sdb = new DialBackground(gp);
GradientPaintTransformType gradientPaintTransformType=GradientPaintTransformType.VERTICAL;
if(horizontalView){
gradientPaintTransformType=GradientPaintTransformType.HORIZONTAL;
}
sdb.setGradientPaintTransformer(new StandardGradientPaintTransformer(
gradientPaintTransformType));
plot.addLayer(sdb);
if(! ( increment > 0) ){
logger.warn("increment cannot be less than 0, put default to 0.1 ");
increment=0.1;
}
StandardDialScale scale=null;
if(!horizontalView){
scale = new StandardDialScale(lower, upper, -8, 16.0,
increment, minorTickCount);
}
else{
scale = new StandardDialScale(lower, upper, 115.0,
-50.0, increment, minorTickCount);
}
// 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.70);
range.setOuterRadius(0.75);
plot.addLayer(range);
}
scale.setTickRadius(0.88);
scale.setTickLabelOffset(0.07);
//set tick label style
Font tickLabelsFont = new Font(labelsTickStyle.getFontName(), Font.PLAIN, labelsTickStyle.getSize());
scale.setTickLabelFont(tickLabelsFont);
scale.setTickLabelPaint(labelsTickStyle.getColor());
//scale.setMajorTickIncrement(25.0);
plot.addScale(0, scale);
DialPointer needle = new DialPointer.Pin();
needle.setRadius(0.82);
plot.addLayer(needle);
DialValueIndicator dvi = new DialValueIndicator(0);
dvi.setFont(new Font(labelsValueStyle.getFontName(), Font.PLAIN, labelsValueStyle.getSize()));
dvi.setPaint(labelsValueStyle.getColor());
plot.addLayer(dvi);
JFreeChart chart1 = new JFreeChart(plot);
chart1.setBackgroundPaint(color);
TextTitle title = setStyleTitle(name, styleTitle);