List of usage examples for org.jfree.chart.title TextTitle TextTitle
public TextTitle(String text)
From source file:net.sf.jasperreports.chartthemes.simple.SimpleChartTheme.java
protected void setChartSubtitles(JFreeChart jfreeChart) throws JRException { TitleSettings subtitleSettings = getSubtitleSettings(); Boolean subtitleVisibility = subtitleSettings.getShowTitle(); if (subtitleVisibility == null || subtitleVisibility) { String subtitleText = evaluateTextExpression(getChart().getSubtitleExpression()); if (subtitleText != null) { TextTitle subtitle = new TextTitle(subtitleText); Paint subtitleForecolor = getChart().getOwnSubtitleColor() != null ? getChart().getOwnSubtitleColor() : subtitleSettings.getForegroundPaint() != null ? subtitleSettings.getForegroundPaint().getPaint() : getChart().getSubtitleColor(); //Subtitle has not its own position set, and by default this will be set the same as title position RectangleEdge subtitleEdge = getEdge(subtitleSettings.getPositionValue(), jfreeChart.getTitle() == null ? null : jfreeChart.getTitle().getPosition()); handleTitleSettings(subtitle, subtitleSettings, getChart().getSubtitleFont(), subtitleForecolor, subtitleEdge);/*w w w . java2 s . c om*/ jfreeChart.addSubtitle(subtitle); } } }