protected void configureChart(final JFreeChart chart)
{
super.configureChart(chart);
final XYPlot plot = chart.getXYPlot();
if (isSharedRangeAxis() == false)
{
final ValueAxis linesAxis = plot.getRangeAxis(1);
if (linesAxis instanceof NumberAxis)
{
final NumberAxis numberAxis = (NumberAxis) linesAxis;
if (getLinePeriodCount() > 0)
{
if (getLineTicksLabelFormat() != null)
{
final FastDecimalFormat formatter = new FastDecimalFormat
(getLineTicksLabelFormat(), getResourceBundleFactory().getLocale());
numberAxis.setTickUnit(new FastNumberTickUnit(getLinePeriodCount(), formatter));
}
else
{
numberAxis.setTickUnit(new FastNumberTickUnit(getLinePeriodCount()));
}
}
else
{
if (getLineTicksLabelFormat() != null)
{
final DecimalFormat formatter = new DecimalFormat
(getLineTicksLabelFormat(), new DecimalFormatSymbols(getResourceBundleFactory().getLocale()));
numberAxis.setNumberFormatOverride(formatter);
}
}
}
else if (linesAxis instanceof DateAxis)
{
final DateAxis numberAxis = (DateAxis) linesAxis;
if (getLinePeriodCount() > 0 && getLineTimePeriod() != null)
{
if (getLineTicksLabelFormat() != null)
{
final SimpleDateFormat formatter = new SimpleDateFormat
(getLineTicksLabelFormat(), new DateFormatSymbols(getResourceBundleFactory().getLocale()));
numberAxis.setTickUnit
(new DateTickUnit(getDateUnitAsInt(getLineTimePeriod()), (int) getLinePeriodCount(), formatter));
}
else
{
numberAxis.setTickUnit
(new DateTickUnit(getDateUnitAsInt(getLineTimePeriod()), (int) getLinePeriodCount()));
}
}
else if (getRangeTickFormatString() != null)
{
final SimpleDateFormat formatter = new SimpleDateFormat
(getRangeTickFormatString(), new DateFormatSymbols(getResourceBundleFactory().getLocale()));
numberAxis.setDateFormatOverride(formatter);
}
}
if (linesAxis != null)
{
final Font labelFont = Font.decode(getLabelFont());
linesAxis.setLabelFont(labelFont);
linesAxis.setTickLabelFont(labelFont);
if (getLineTitleFont() != null)
{
linesAxis.setLabelFont(getLineTitleFont());
}
if (getLineTickFont() != null)
{
linesAxis.setTickLabelFont(getLineTickFont());
}
final Double lineRangeMin = getLineRangeMinimum();
if (lineRangeMin != null)
{
linesAxis.setLowerBound(lineRangeMin.doubleValue());
}
final Double lineRangeMax = getLineRangeMaximum();
if (lineRangeMax != null)
{
linesAxis.setUpperBound(lineRangeMax.doubleValue());
}
}
}
final XYLineAndShapeRenderer linesRenderer = (XYLineAndShapeRenderer) plot.getRenderer(1);
if (linesRenderer != null)
{
//set stroke with line width
linesRenderer.setStroke(translateLineStyle(getLineWidth(), getLineStyle()));
//hide shapes on line