Package org.jfree.chart.title

Examples of org.jfree.chart.title.LegendTitle


      }
     
      JFreeChart chart = new JFreeChart(title, plot);
      chart.removeLegend();
      // chart.addSubtitle(new TextTitle(""));
      LegendTitle legend = new LegendTitle(plot);
      legend.setFrame(new BlockBorder());
      legend.setPosition(RectangleEdge.BOTTOM);
      chart.addSubtitle(legend);
     
      // generate jpeg
     
      ByteArrayOutputStream bos = new ByteArrayOutputStream();
View Full Code Here


      String title = "Call Mix";
     
      JFreeChart chart = new JFreeChart(title, plot);
      chart.removeLegend();
      // chart.addSubtitle(new TextTitle(""));
      LegendTitle legend = new LegendTitle(plot);
      legend.setFrame(new BlockBorder());
      legend.setPosition(RectangleEdge.BOTTOM);
      chart.addSubtitle(legend);
     
      // generate jpeg
           
      ByteArrayOutputStream bos = new ByteArrayOutputStream();
View Full Code Here

        false // urls
        );

    // NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART...

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

    chart.setBackgroundPaint(Color.white);

    final CategoryPlot plot = chart.getCategoryPlot();
View Full Code Here

        false // urls
        );

    // NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART...

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

    chart.setBackgroundPaint(Color.white);

    final CategoryPlot plot = chart.getCategoryPlot();
View Full Code Here

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

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

    chart.setBackgroundPaint(Color.white);

    final CategoryPlot plot = chart.getCategoryPlot();
View Full Code Here

        false // urls
        );

    // NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART...

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

    chart.setBackgroundPaint(Color.white);

    final CategoryPlot plot = chart.getCategoryPlot();
View Full Code Here

    chart.setAntiAlias(true);
    chart.setTextAntiAlias(true);

    chart.removeLegend();
    if (legendPosition != null) {
      LegendTitle legend = new LegendTitle(chart.getPlot());
      legend.setPosition(legendPosition);
      legend.setItemPaint(BASE_COLOR);
      chart.addSubtitle(legend);
    }
  }
View Full Code Here

            renderer.setSeriesShape(i, new Ellipse2D.Double(-delta, -delta, size, size));
            renderer.setSeriesPaint(i, colors.get(i));

        }

        chart.addLegend(new LegendTitle(lis));
        chart.getLegend().setMargin(2,0,-7,10);
        chart.getLegend().setVerticalAlignment(VerticalAlignment.TOP);
        chart.getLegend().setHorizontalAlignment(HorizontalAlignment.RIGHT);
        chart.getLegend().setLegendItemGraphicPadding(new RectangleInsets(5,5,5,5));
View Full Code Here

      lis.getLegendItems().add(legendItem);
    }

    // finalize legend
        if (showLegend) {
            chart.addLegend(new LegendTitle(lis));
            chart.getLegend().setMargin(2,0,-7,10);
            chart.getLegend().setVerticalAlignment(VerticalAlignment.TOP);
            chart.getLegend().setHorizontalAlignment(HorizontalAlignment.RIGHT);
            chart.getLegend().setLegendItemGraphicPadding(new RectangleInsets(5,5,5,5));
        }
View Full Code Here

    /**
     * Check that the equals() method distinguishes all fields.
     */
    public void testEquals() {
        XYPlot plot1 = new XYPlot();
        LegendTitle t1 = new LegendTitle(plot1);
        LegendTitle t2 = new LegendTitle(plot1);
        assertEquals(t1, t2);
       
        t1.setBackgroundPaint(
            new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f, Color.yellow)
        );
        assertFalse(t1.equals(t2));
        t2.setBackgroundPaint(
            new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f, Color.yellow)
        );
        assertTrue(t1.equals(t2));
       
        t1.setLegendItemGraphicEdge(RectangleEdge.BOTTOM);
        assertFalse(t1.equals(t2));
        t2.setLegendItemGraphicEdge(RectangleEdge.BOTTOM);
        assertTrue(t1.equals(t2));
       
        t1.setLegendItemGraphicAnchor(RectangleAnchor.BOTTOM_LEFT);
        assertFalse(t1.equals(t2));
        t2.setLegendItemGraphicAnchor(RectangleAnchor.BOTTOM_LEFT);
        assertTrue(t1.equals(t2));
       
        t1.setLegendItemGraphicLocation(RectangleAnchor.TOP_LEFT);
        assertFalse(t1.equals(t2));
        t2.setLegendItemGraphicLocation(RectangleAnchor.TOP_LEFT);
        assertTrue(t1.equals(t2));
       
        t1.setItemFont(new Font("Dialog", Font.PLAIN, 19));
        assertFalse(t1.equals(t2));
        t2.setItemFont(new Font("Dialog", Font.PLAIN, 19));
        assertTrue(t1.equals(t2));
    }
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.