Package org.jfree.chart

Examples of org.jfree.chart.JFreeChart.addSubtitle()


      }
      chart.addSubtitle(new TextTitle(subTitle1));

      String subTitle2 = "Center Freq: " + freqString
         + "Bandwidth: " + bandwidthString;
      chart.addSubtitle(new TextTitle(subTitle2));

      // move the data off of the axes
      // by extending the minimum axis value

      XYPlot plot = (XYPlot) ((JFreeChart) chart).getPlot();
View Full Code Here


        // return a new chart containing the overlaid plot...
        JFreeChart chart = new JFreeChart("CombinedXYPlotDemo1",
                JFreeChart.DEFAULT_TITLE_FONT, cplot, false);
        chart.setBackgroundPaint(Color.white);
        LegendTitle legend = new LegendTitle(cplot);
        chart.addSubtitle(legend);
        return chart;
    }

    /**
     * Creates a sample dataset.  You wouldn't normally hard-code the
View Full Code Here

        chart.setBackgroundPaint(Color.white);
        chart.setBorderVisible(true);
        chart.setBorderPaint(Color.BLACK);
        TextTitle subtitle = new TextTitle("Four datasets and four range axes.")
        chart.addSubtitle(subtitle);
        XYPlot plot = (XYPlot) chart.getPlot();
        plot.setOrientation(PlotOrientation.VERTICAL);
        plot.setBackgroundPaint(Color.lightGray);
        plot.setDomainGridlinePaint(Color.white);
        plot.setRangeGridlinePaint(Color.white);
View Full Code Here

  private JFreeChart createChart(XYDataset xydataset) {
    JFreeChart jfreechart = ChartFactory.createXYLineChart(null, "Age in Months", "Weight (kg)", xydataset, PlotOrientation.VERTICAL, true, true, false);
    TextTitle texttitle = new TextTitle("Growth Charts: United States", new Font("SansSerif", 1, 14));
    TextTitle texttitle1 = new TextTitle("Weight-for-age percentiles: boys, birth to 36 months", new Font("SansSerif", 0, 11));
    jfreechart.addSubtitle(texttitle);
    jfreechart.addSubtitle(texttitle1);
    XYPlot xyplot = (XYPlot) jfreechart.getPlot();
    xyplot.setDomainPannable(true);
    xyplot.setRangePannable(true);
    NumberAxis numberaxis = (NumberAxis)xyplot.getDomainAxis();
View Full Code Here

  private JFreeChart createChart(XYDataset xydataset) {
    JFreeChart jfreechart = ChartFactory.createXYLineChart(null, "Age in Months", "Weight (kg)", xydataset, PlotOrientation.VERTICAL, true, true, false);
    TextTitle texttitle = new TextTitle("Growth Charts: United States", new Font("SansSerif", 1, 14));
    TextTitle texttitle1 = new TextTitle("Weight-for-age percentiles: boys, birth to 36 months", new Font("SansSerif", 0, 11));
    jfreechart.addSubtitle(texttitle);
    jfreechart.addSubtitle(texttitle1);
    XYPlot xyplot = (XYPlot) jfreechart.getPlot();
    xyplot.setDomainPannable(true);
    xyplot.setRangePannable(true);
    NumberAxis numberaxis = (NumberAxis)xyplot.getDomainAxis();
    numberaxis.setUpperMargin(0.12D);
View Full Code Here

    jfreechart.setBackgroundPaint(Color.white);
    TextTitle texttitle = new TextTitle("An area chart demonstration.  We use this subtitle as an example of what happens when you get a really long title or subtitle.");
    texttitle.setPosition(RectangleEdge.TOP);
    texttitle.setPadding(new RectangleInsets(UnitType.RELATIVE, 0.050000000000000003D, 0.050000000000000003D, 0.050000000000000003D, 0.050000000000000003D));
    texttitle.setVerticalAlignment(VerticalAlignment.BOTTOM);
    jfreechart.addSubtitle(texttitle);
    CategoryPlot categoryplot = (CategoryPlot)jfreechart.getPlot();
    categoryplot.setForegroundAlpha(0.5F);
    categoryplot.setDomainGridlinesVisible(true);
    CategoryAxis categoryaxis = categoryplot.getDomainAxis();
    categoryaxis.setCategoryLabelPositions(CategoryLabelPositions.UP_45);
View Full Code Here

    blockcontainer.add(new EmptyBlock(2000D, 0.0D));
    CompositeTitle compositetitle = new CompositeTitle(blockcontainer);
    compositetitle.setFrame(new BlockBorder(Color.red));
    compositetitle.setBackgroundPaint(Color.yellow);
    compositetitle.setPosition(RectangleEdge.BOTTOM);
    jfreechart.addSubtitle(compositetitle);
    ChartUtilities.applyCurrentTheme(jfreechart);
    return jfreechart;
  }
 
  private static XYDataset createDataset1() {
View Full Code Here

    // Subtitle.
    chartSubTitle = new TextTitle();
    chartSubTitle.setFont(SUBTITLE_FONT);
    chartSubTitle.setMargin(TITLE_TOP_MARGIN, 0.0, 0.0, 0.0);
    chart.addSubtitle(chartSubTitle);

    // Disable maximum size (we don't want scaling).
    setMaximumDrawWidth(Integer.MAX_VALUE);
    setMaximumDrawHeight(Integer.MAX_VALUE);
View Full Code Here

      paintscalelegend.setFrame(new BlockBorder(Color.red));
      paintscalelegend.setPadding(new RectangleInsets(10D, 10D, 10D, 10D));
      paintscalelegend.setStripWidth(10D);
      paintscalelegend.setPosition(RectangleEdge.RIGHT);
      paintscalelegend.setBackgroundPaint(new Color(120, 120, 180));
      jfreechart.addSubtitle(paintscalelegend);
      jfreechart.setBackgroundPaint(new Color(180, 180, 250));
      return jfreechart;
    }

    /**
 
View Full Code Here

        assertTrue(chart1.equals(chart2));
       
        // subtitles
        chart1.addSubtitle(new TextTitle("Subtitle"));
        assertFalse(chart1.equals(chart2));
        chart2.addSubtitle(new TextTitle("Subtitle"));
        assertTrue(chart1.equals(chart2));
       
        // plot
        chart1 = new JFreeChart("Title",
                new Font("SansSerif", Font.PLAIN, 12), new RingPlot(), false);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.