Package org.jfree.chart.title

Examples of org.jfree.chart.title.LegendTitle


      {
         this.subtitles.remove(getLegend());
         getLegend().removeChangeListener((TitleChangeListener) this);
      }

      LegendTitle lgd = new LegendTitle(this._plot_);
      lgd.setMargin(new RectangleInsets(
            1.0, 1.0, 1.0, 1.0));

      lgd.setFrame(new LineBorder());
      lgd.setBackgroundPaint(Color.white);
      lgd.setPosition(RectangleEdge.BOTTOM);


      lgd.addChangeListener((TitleChangeListener) this);
     
      addLegend(lgd);
   }
View Full Code Here


        true, // include legend
        true, // tooltips
        false // urls
        );

    final LegendTitle legend = chart.getLegend();
    legend.setPosition(RectangleEdge.RIGHT);

    chart.setBackgroundPaint(Color.white);
    CategoryPlot plot = (CategoryPlot) chart.getPlot();

    plot.setBackgroundPaint(Color.WHITE);
View Full Code Here

        // remove the old legend
        confidenceChart.removeLegend();

        // add the new legend
        confidenceChart.addLegend(new LegendTitle(source));
        confidenceChart.getLegend().setFrame(tempFrame);
        confidenceChart.getLegend().setPosition(RectangleEdge.BOTTOM);

        // set background color
        confidenceChart.getPlot().setBackgroundPaint(Color.WHITE);
View Full Code Here

    Color bg = backgroundcolor==null?databackgroundcolor:backgroundcolor;
    if(font==null)font=getFont();
   
   
   
    LegendTitle legend = legendMultiLine?
            new LegendTitle(plot,new ColumnArrangement(), new ColumnArrangement()):
            new LegendTitle(plot);
        legend.setBackgroundPaint(bg);
        legend.setMargin(new RectangleInsets(1.0, 1.0, 1.0, 1.0));
        legend.setFrame(new LineBorder());
        legend.setPosition(RectangleEdge.BOTTOM);
        legend.setHorizontalAlignment(HorizontalAlignment.LEFT);
       
        legend.setWidth(chartwidth-20);// geht nicht
        legend.setItemFont(font);
    legend.setItemPaint(foregroundcolor);

    //RectangleInsets labelPadding;
    legend.setItemLabelPadding(new RectangleInsets(2,2,2,2));
    legend.setBorder(0,0,0,0);
    legend.setLegendItemGraphicLocation(RectangleAnchor.TOP_LEFT);
    legend.setLegendItemGraphicPadding(new RectangleInsets(8,10,0,0));
    chart.addLegend(legend);
   
  }
View Full Code Here

        this.subtitles = new ArrayList();

        // create a legend, if requested...
        if (createLegend) {
            LegendTitle legend = new LegendTitle(this.plot);
            legend.setMargin(new RectangleInsets(1.0, 1.0, 1.0, 1.0));
            legend.setFrame(new LineBorder());
            legend.setBackgroundPaint(Color.white);
            legend.setPosition(RectangleEdge.BOTTOM);
            this.subtitles.add(legend);
            legend.addChangeListener(this);
        }

        // add the chart title, if one has been specified...
        if (title != null) {
            if (titleFont == null) {
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;
    }
View Full Code Here

            TextTitle tt = (TextTitle) title;
            tt.setFont(this.largeFont);
            tt.setPaint(this.subtitlePaint);
        }
        else if (title instanceof LegendTitle) {
            LegendTitle lt = (LegendTitle) title;
            if (lt.getBackgroundPaint() != null) {
                lt.setBackgroundPaint(this.legendBackgroundPaint);
            }
            lt.setItemFont(this.regularFont);
            lt.setItemPaint(this.legendItemPaint);
            if (lt.getWrapper() != null) {
                applyToBlockContainer(lt.getWrapper());
            }
        }
        else if (title instanceof PaintScaleLegend) {
            PaintScaleLegend psl = (PaintScaleLegend) title;
            psl.setBackgroundPaint(this.legendBackgroundPaint);
View Full Code Here

    xylineandshaperenderer.setBaseToolTipGenerator(StandardXYToolTipGenerator.getTimeSeriesInstance());
    XYPointerAnnotation xypointerannotation1 = new XYPointerAnnotation("Annotation 2 (15.0, 613.2)", 15D, 613.20000000000005D, 1.5707963267948966D);
    xypointerannotation1.setTextAnchor(TextAnchor.TOP_CENTER);
    xylineandshaperenderer1.addAnnotation(xypointerannotation1);
    xyplot.setRenderer(1, xylineandshaperenderer1);
    LegendTitle legendtitle = new LegendTitle(xylineandshaperenderer);
    LegendTitle legendtitle1 = new LegendTitle(xylineandshaperenderer1);
    BlockContainer blockcontainer = new BlockContainer(new BorderArrangement());
    blockcontainer.add(legendtitle, RectangleEdge.LEFT);
    blockcontainer.add(legendtitle1, RectangleEdge.RIGHT);
    blockcontainer.add(new EmptyBlock(2000D, 0.0D));
    CompositeTitle compositetitle = new CompositeTitle(blockcontainer);
View Full Code Here

    chartSubTitle.setFont(subTitleFont);
    chartSubTitle.setMargin(5, 0, 0, 0);
    chart.addSubtitle(chartSubTitle);

    // legend constructed by ChartFactory
    LegendTitle legend = chart.getLegend();
    legend.setItemFont(legendFont);
    legend.setFrame(BlockBorder.NONE);

    chart.setBackgroundPaint(Color.white);
    setChart(chart);

    // disable maximum size (we don't want scaling)
View Full Code Here

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

    // Legend constructed by ChartFactory.
    final LegendTitle legend = chart.getLegend();
    legend.setItemFont(LEGEND_FONT);
    legend.setFrame(BlockBorder.NONE);

    // Set the plot properties.
    plot = chart.getXYPlot();
    plot.setBackgroundPaint(Color.white);
    plot.setAxisOffset(AXIS_OFFSET);
View Full Code Here

TOP

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

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.