protected void configureChart(final JFreeChart chart)
{
super.configureChart(chart);
final CategoryPlot cpl = chart.getCategoryPlot();
final CategoryItemRenderer renderer = cpl.getRenderer();
if (StringUtils.isEmpty(getTooltipFormula()) == false)
{
renderer.setBaseToolTipGenerator(new FormulaCategoryTooltipGenerator(getRuntime(), getTooltipFormula()));
}
if (StringUtils.isEmpty(getUrlFormula()) == false)
{
renderer.setBaseItemURLGenerator(new FormulaCategoryURLGenerator(getRuntime(), getUrlFormula()));
}
if (this.categoricalLabelFormat != null)
{
final StandardCategoryItemLabelGenerator scilg;
if (categoricalLabelDecimalFormat != null)
{
scilg = new StandardCategoryItemLabelGenerator(categoricalLabelFormat,
new DecimalFormat(categoricalLabelDecimalFormat));
}
else if (categoricalLabelDateFormat != null)
{
scilg = new StandardCategoryItemLabelGenerator(categoricalLabelFormat,
new SimpleDateFormat(categoricalLabelDateFormat));
}
else
{
scilg = new StandardCategoryItemLabelGenerator(categoricalLabelFormat, new DecimalFormat());
}
renderer.setBaseItemLabelGenerator(scilg);
}
renderer.setBaseItemLabelsVisible(Boolean.TRUE.equals(getItemsLabelVisible()));
if (getItemLabelFont() != null)
{
renderer.setBaseItemLabelFont(getItemLabelFont());
}
if (categoricalItemLabelRotation != null)
{
final ItemLabelPosition orgPosItemLabelPos = renderer.getBasePositiveItemLabelPosition();
if (orgPosItemLabelPos == null)
{
final ItemLabelPosition pos2 = new ItemLabelPosition
(ItemLabelAnchor.OUTSIDE12, TextAnchor.BOTTOM_CENTER,
TextAnchor.CENTER, categoricalItemLabelRotation.doubleValue());
renderer.setBasePositiveItemLabelPosition(pos2);
}
else
{
final ItemLabelPosition pos2 = new ItemLabelPosition
(orgPosItemLabelPos.getItemLabelAnchor(), orgPosItemLabelPos.getTextAnchor(),
orgPosItemLabelPos.getRotationAnchor(), categoricalItemLabelRotation.doubleValue());
renderer.setBasePositiveItemLabelPosition(pos2);
}
final ItemLabelPosition orgNegItemLabelPos = renderer.getBaseNegativeItemLabelPosition();
if (orgNegItemLabelPos == null)
{
final ItemLabelPosition pos2 = new ItemLabelPosition
(ItemLabelAnchor.OUTSIDE12, TextAnchor.BOTTOM_CENTER,
TextAnchor.CENTER, categoricalItemLabelRotation.doubleValue());
renderer.setBaseNegativeItemLabelPosition(pos2);
}
else
{
final ItemLabelPosition neg2 = new ItemLabelPosition
(orgNegItemLabelPos.getItemLabelAnchor(), orgNegItemLabelPos.getTextAnchor(),
orgNegItemLabelPos.getRotationAnchor(), categoricalItemLabelRotation.doubleValue());
renderer.setBaseNegativeItemLabelPosition(neg2);
}
}
final Font labelFont = Font.decode(getLabelFont());
final CategoryAxis categoryAxis = cpl.getDomainAxis();
categoryAxis.setLabelFont(labelFont);
categoryAxis.setTickLabelFont(labelFont);
if (getCategoryTitleFont() != null)
{
categoryAxis.setLabelFont(getCategoryTitleFont());
}
if (getCategoryTickFont() != null)
{
categoryAxis.setTickLabelFont(getCategoryTickFont());
}
if (maxCategoryLabelWidthRatio != null)
{
categoryAxis.setMaximumCategoryLabelWidthRatio(maxCategoryLabelWidthRatio.floatValue());
}
cpl.setDomainGridlinesVisible(showGridlines);
if (labelRotation != null)
{
categoryAxis.setCategoryLabelPositions
(CategoryLabelPositions.createUpRotationLabelPositions(labelRotation.doubleValue()));
}
final String[] colors = getSeriesColor();
for (int i = 0; i < colors.length; i++)
{
renderer.setSeriesPaint(i, parseColorFromString(colors[i]));
}
if (lowerMargin != null)
{
categoryAxis.setLowerMargin(lowerMargin.doubleValue());