Package org.jfree.chart.title

Examples of org.jfree.chart.title.TextTitle


    // create the chart
    JFreeChart pieChart = ChartFactory.createPieChart("Open Tickets by User", pieData, true, true, false);

    // add the "Total Open Tickets" sub-title
    TextTitle t1 = new TextTitle("Total Open Tickets: " + String.valueOf(totalTickets),
                                 new Font("SansSerif", Font.PLAIN, 11));
    pieChart.addSubtitle(t1);

    // set the chart visual options
    PiePlot plot = (PiePlot)pieChart.getPlot();
View Full Code Here


    // create the chart
    JFreeChart pieChart = ChartFactory.createPieChart("Opportunities by Stage", pieData, true, true, false);

    // set the sub-title
    TextTitle t1 = new TextTitle("Total Forecasted: " + totalForecastString + "           " +
                                 "Total Amount: " + totalActualString,
                                 new Font("SansSerif", Font.PLAIN, 11));
    pieChart.addSubtitle(t1);

    // set the chart visual options
View Full Code Here

    JFreeChart barChart = ChartFactory.createStackedBarChart("Opportunities by Month", "Month", "Opportunity Value ($)",
                                                             chartData, org.jfree.chart.plot.PlotOrientation.VERTICAL,
                                                             true, true, false);

    // set the sub-title
    TextTitle t1 = new TextTitle("Total Forecasted: " + totalForecastString + "           " +
                                 "Total Amount: " + totalActualString,
                                 new Font("SansSerif", Font.PLAIN, 11));
    barChart.addSubtitle(t1);

    // set the chart visual options
View Full Code Here

    plot.setBackgroundPaint(BACKGROUND);
    chart.setBackgroundPaint(BACKGROUND);
   
    // Chart level title
    if(chart.getTitle() != null){
      TextTitle title = chart.getTitle();
      title.setVisible(visibility.isTitle());
      title.setBackgroundPaint(new Color(colors.getTitleBg()));
      title.setPaint(new Color(colors.getTitle()));
      title.setExpandToFitSpace(true);
    }
   
    // In case of multiple plot read and update child level chart
    if(plot instanceof MultiplePiePlot){
      MultiplePiePlot multiplePiePlot = (MultiplePiePlot)plot;
View Full Code Here

  }

  protected void configureChart(final JFreeChart chart)
  {
    // Misc Properties
    final TextTitle chartTitle = chart.getTitle();
    if (chartTitle != null)
    {
      final Font titleFont = Font.decode(getTitleFont());
      chartTitle.setFont(titleFont);
    }

    if (isAntiAlias() == false)
    {
      chart.setAntiAlias(false);
View Full Code Here

    }
  }

  protected void configureSubChart(final JFreeChart chart)
  {
    final TextTitle chartTitle = chart.getTitle();
    if (chartTitle != null)
    {
      if (getPieTitleFont() != null)
      {
        chartTitle.setFont(getPieTitleFont());
      }
      else
      {
        final Font titleFont = Font.decode(getTitleFont());
        chartTitle.setFont(titleFont);
      }
    }

    if (isAntiAlias() == false)
    {
View Full Code Here

   
    RectangleEdge titleEdge = getEdge(chartSettings.getTitlePosition(), RectangleEdge.TOP);
   
    if (titleText != null)
    {
      TextTitle title = jfreechart.getTitle();
      title.setText(titleText);
      if(chartSettings.getTitleColor() != null)
      {
        title.setPaint(chartSettings.getTitleColor());
      }
     
      title.setFont(titleFont);
      title.setPosition(titleEdge);
      jfreechart.setTitle(title);
    }

        String subtitleText = spiderchartBean.getSubtitleText();
    if (subtitleText != null)
    {
      TextTitle subtitle = new TextTitle(subtitleText);
      subtitle.setText(subtitleText);
      if(chartSettings.getSubtitleColor() != null)
      {
        subtitle.setPaint(chartSettings.getSubtitleColor());
      }

      if(chartSettings.getSubtitleColor() != null)
      {
            Font subtitleFont = chartSettings.getSubtitleFont() != null
            ? JRFontUtil.getAwtFont(chartSettings.getSubtitleFont(), Locale.getDefault())
            : TextTitle.DEFAULT_FONT;
        subtitle.setFont(subtitleFont);
      }
     
      subtitle.setPosition(titleEdge);

      jfreechart.addSubtitle(subtitle);
    }

    // Apply all of the legend formatting options
View Full Code Here

   
    RectangleEdge titleEdge = getEdge(getChart().getTitlePositionValue(), RectangleEdge.TOP);
   
    if (jfreeChart.getTitle() != null)
    {
      TextTitle title = jfreeChart.getTitle();
      title.setPaint(getChart().getTitleColor());

      title.setFont(JRFontUtil.getAwtFont(getChart().getTitleFont(), getLocale()));
      title.setPosition(titleEdge);
    }

    String subtitleText = (String)evaluateExpression(getChart().getSubtitleExpression());
    if (subtitleText != null)
    {
      TextTitle subtitle = new TextTitle(subtitleText);
      subtitle.setPaint(getChart().getSubtitleColor());

      subtitle.setFont(JRFontUtil.getAwtFont(getChart().getSubtitleFont(), getLocale()));
      subtitle.setPosition(titleEdge);

      jfreeChart.addSubtitle(subtitle);
    }

    // Apply all of the legend formatting options
View Full Code Here

  {
    TitleSettings titleSettings =  getTitleSettings();
    Boolean showTitle = titleSettings.getShowTitle();
    if(showTitle == null || showTitle.booleanValue())
    {
      TextTitle title = jfreeChart.getTitle();
         
      if(title != null)
      {
        Paint forePaint = getChart().getOwnTitleColor();
        if (forePaint == null && titleSettings.getForegroundPaint() != null)
View Full Code Here

    if(subtitleVisibility == null || subtitleVisibility.booleanValue())
    {
      String subtitleText = (String)evaluateExpression(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();
View Full Code Here

TOP

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

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.