(range.getUpperBound() - range.getLowerBound())/6,
15
);
scale.setTickRadius(0.9);
scale.setTickLabelOffset(0.16);
JRBaseFont font = new JRBaseFont();
JRFontUtil.copyNonNullOwnProperties(getPlotSettings().getTickLabelFont(), font);
JRFontUtil.copyNonNullOwnProperties(jrPlot.getTickLabelFont(), font);
font = new JRBaseFont(getChart(), font);
scale.setTickLabelFont(JRFontUtil.getAwtFont(font, getLocale()));
scale.setMajorTickStroke(new BasicStroke(1f));
scale.setMinorTickStroke(new BasicStroke(0.3f));
scale.setMajorTickPaint(jrPlot.getTickColor());
scale.setMinorTickPaint(jrPlot.getTickColor());
scale.setTickLabelsVisible(true);
scale.setFirstTickLabelVisible(true);
dialPlot.addScale(0, scale);
List intervals = jrPlot.getIntervals();
if (intervals != null && intervals.size() > 0)
{
int size = Math.min(3, intervals.size());
int colorStep = 0;
if(size > 0)
colorStep = 255 / size;
for(int i = 0; i < size; i++)
{
JRMeterInterval interval = (JRMeterInterval)intervals.get(i);
Range intervalRange = convertRange(interval.getDataRange());
Color color = new Color(255 - colorStep * i, 0 + colorStep * i, 0);
StandardDialRange dialRange =
new StandardDialRange(
intervalRange.getLowerBound(),
intervalRange.getUpperBound(),
interval.getBackgroundColor() == null
? color
: interval.getBackgroundColor()
);
dialRange.setInnerRadius(0.41);
dialRange.setOuterRadius(0.41);
dialPlot.addLayer(dialRange);
}
}
JRValueDisplay display = jrPlot.getValueDisplay();
String displayVisibility = display != null && getChart().hasProperties() ?
getChart().getPropertiesMap().getProperty(DefaultChartTheme.PROPERTY_DIAL_VALUE_DISPLAY_VISIBLE) : "false";
if(Boolean.parseBoolean(displayVisibility))
{
DialValueIndicator dvi = new DialValueIndicator(0);
dvi.setBackgroundPaint(ChartThemesConstants.TRANSPARENT_PAINT);
// dvi.setFont(JRFontUtil.getAwtFont(jrFont).deriveFont(10f).deriveFont(Font.BOLD));
dvi.setOutlinePaint(ChartThemesConstants.TRANSPARENT_PAINT);
dvi.setPaint(Color.WHITE);
String pattern = display.getMask() != null ? display.getMask() : "#,##0.####";
if(pattern != null)
dvi.setNumberFormat( new DecimalFormat(pattern));
dvi.setRadius(0.15);
dvi.setValueAnchor(RectangleAnchor.CENTER);
dvi.setTextAnchor(TextAnchor.CENTER);
//dvi.setTemplateValue(Double.valueOf(getDialTickValue(dialPlot.getValue(0),dialUnitScale)));
dialPlot.addLayer(dvi);
}
String label = getChart().hasProperties() ?
getChart().getPropertiesMap().getProperty(DefaultChartTheme.PROPERTY_DIAL_LABEL) : null;
if(label != null)
{
JRFont displayFont = new JRBaseFont();
JRFontUtil.copyNonNullOwnProperties(getPlotSettings().getDisplayFont(), displayFont);
JRFontUtil.copyNonNullOwnProperties(jrPlot.getValueDisplay().getFont(), displayFont);
displayFont = new JRBaseFont(getChart(), displayFont);
Font themeDisplayFont = JRFontUtil.getAwtFont(displayFont, getLocale());
String[] textLines = label.split("\\n");
for(int i = 0; i < textLines.length; i++)
{