Java Code Examples for org.jfree.chart.JFreeChart#getSubtitles()

The following examples show how to use org.jfree.chart.JFreeChart#getSubtitles() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JFreeChartTests.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Some checks for the getSubtitles() method.
 */
public void testGetSubtitles() {
    DefaultPieDataset dataset = new DefaultPieDataset();
    JFreeChart chart = ChartFactory.createPieChart("title", dataset, true);
    List subtitles = chart.getSubtitles();

    assertEquals(1, chart.getSubtitleCount());

    // adding something to the returned list should NOT change the chart
    subtitles.add(new TextTitle("T"));
    assertEquals(1, chart.getSubtitleCount());
}
 
Example 2
Source File: JFreeChartTests.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Some checks for the getSubtitles() method.
 */
public void testGetSubtitles() {
    DefaultPieDataset dataset = new DefaultPieDataset();
    JFreeChart chart = ChartFactory.createPieChart("title", dataset, true, 
            false, false);
    List subtitles = chart.getSubtitles();
    
    assertEquals(1, chart.getSubtitleCount());
    
    // adding something to the returned list should NOT change the chart
    subtitles.add(new TextTitle("T"));
    assertEquals(1, chart.getSubtitleCount());
}