Package org.jfree.chart.title

Examples of org.jfree.chart.title.Title


  public static void applyStyles(JFreeChart chart) {
    chart.getTitle().setFont(WidgetUtils.FONT_HEADER1);
    chart.getTitle().setBackgroundPaint(WidgetUtils.BG_COLOR_BRIGHTEST);

    for (int i = 0; i < chart.getSubtitleCount(); i++) {
      Title subtitle = chart.getSubtitle(i);
      if (subtitle instanceof TextTitle) {
        ((TextTitle) subtitle).setFont(WidgetUtils.FONT_NORMAL);
      }
    }
View Full Code Here


    drillToOverview();

    // chart for display of the dataset
    final JFreeChart chart = ChartFactory.createPieChart("Value distribution of " + _groupOrColumnName, _dataset, false,
        true, false);
    Title totalCountSubtitle = new ShortTextTitle("Total count: " + totalCount);
    Title distinctCountSubtitle = new ShortTextTitle("Distinct count: " + distinctCount);
    chart.setSubtitles(Arrays.asList(totalCountSubtitle, distinctCountSubtitle));

    ChartUtils.applyStyles(chart);

    // code-block for tweaking style and coloring of chart
View Full Code Here

        general.add(interior, BorderLayout.NORTH);
        other.add(general, BorderLayout.NORTH);

        JPanel parts = new JPanel(new BorderLayout());

        Title title = chart.getTitle();
        Plot plot = chart.getPlot();

        JTabbedPane tabs = new JTabbedPane();

        this.titleEditor = new DefaultTitleEditor(title);
View Full Code Here

     */
    public void testGetSubtitle() {
        DefaultPieDataset dataset = new DefaultPieDataset();
        JFreeChart chart = ChartFactory.createPieChart("title", dataset, true,
                false, false);
        Title t = chart.getSubtitle(0);
        assertTrue(t instanceof LegendTitle);

        boolean pass = false;
        try {
            t = chart.getSubtitle(-1);
View Full Code Here

     * Some checks for the equals() method.
     */
    public void testEquals() {

        // use the TextTitle class because it is a concrete subclass
        Title t1 = new TextTitle();
        Title t2 = new TextTitle();
        assertEquals(t1, t2);

        t1.setPosition(RectangleEdge.LEFT);
        assertFalse(t1.equals(t2));
        t2.setPosition(RectangleEdge.LEFT);
        assertTrue(t1.equals(t2));

        t1.setHorizontalAlignment(HorizontalAlignment.RIGHT);
        assertFalse(t1.equals(t2));
        t2.setHorizontalAlignment(HorizontalAlignment.RIGHT);
        assertTrue(t1.equals(t2));

        t1.setVerticalAlignment(VerticalAlignment.BOTTOM);
        assertFalse(t1.equals(t2));
        t2.setVerticalAlignment(VerticalAlignment.BOTTOM);
        assertTrue(t1.equals(t2));

        t1.setVisible(false);
        assertFalse(t1.equals(t2));
        t2.setVisible(false);
        assertTrue(t1.equals(t2));

    }
View Full Code Here

     */
    public LegendTitle getLegend(int index) {
        int seen = 0;
        Iterator iterator = this.subtitles.iterator();
        while (iterator.hasNext()) {
            Title subtitle = (Title) iterator.next();
            if (subtitle instanceof LegendTitle) {
                if (seen == index) {
                    return (LegendTitle) subtitle;
                }
                else {
View Full Code Here

        }
        setNotify(false);
        clearSubtitles();
        Iterator iterator = subtitles.iterator();
        while (iterator.hasNext()) {
            Title t = (Title) iterator.next();
            if (t != null) {
                addSubtitle(t);
            }
        }
        setNotify(true)// this fires a ChartChangeEvent
View Full Code Here

     * @see #addSubtitle(Title)
     */
    public void clearSubtitles() {
        Iterator iterator = this.subtitles.iterator();
        while (iterator.hasNext()) {
            Title t = (Title) iterator.next();
            t.removeChangeListener(this);
        }
        this.subtitles.clear();
        fireChartChanged();
    }
View Full Code Here

            }
        }

        Iterator iterator = this.subtitles.iterator();
        while (iterator.hasNext()) {
            Title currentTitle = (Title) iterator.next();
            if (currentTitle.isVisible()) {
                EntityCollection e = drawTitle(currentTitle, g2, nonTitleArea,
                        (entities != null));
                if (e != null) {
                    entities.addAll(e);
                }
View Full Code Here

            chart.title.addChangeListener(chart);
        }

        chart.subtitles = new ArrayList();
        for (int i = 0; i < getSubtitleCount(); i++) {
            Title subtitle = (Title) getSubtitle(i).clone();
            chart.subtitles.add(subtitle);
            subtitle.addChangeListener(chart);
        }

        if (this.plot != null) {
            chart.plot = (Plot) this.plot.clone();
            chart.plot.addChangeListener(chart);
View Full Code Here

TOP

Related Classes of org.jfree.chart.title.Title

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.