Examples of LegendTitle


Examples of org.jfree.chart.title.LegendTitle

    /*LabelBlock titleBlock = new LabelBlock("Legend Items:",
        new Font("SansSerif", Font.BOLD, 12));
    titleBlock.setPadding(5, 5, 5, 5);
    wrapper.add(titleBlock, RectangleEdge.TOP);*/

    LegendTitle legend = new LegendTitle(chart.getPlot());
    BlockContainer items = legend.getItemContainer();
    if(styleLegend!=null && styleLegend.getFont()!=null){
      legend.setItemFont(new Font(styleLegend.getFontName(), Font.BOLD, styleLegend.getSize()));
    }
   
    items.setPadding(2, 5, 5, 2);
    wrapper.add(items);
    legend.setWrapper(wrapper);

    if(legendPosition.equalsIgnoreCase("bottom")) legend.setPosition(RectangleEdge.BOTTOM);
    else if(legendPosition.equalsIgnoreCase("left")) legend.setPosition(RectangleEdge.LEFT);
    else if(legendPosition.equalsIgnoreCase("right")) legend.setPosition(RectangleEdge.RIGHT);
    else if(legendPosition.equalsIgnoreCase("top")) legend.setPosition(RectangleEdge.TOP);
    else legend.setPosition(RectangleEdge.BOTTOM);
   
    legend.setHorizontalAlignment(HorizontalAlignment.CENTER);
    chart.addSubtitle(legend);
   
    }
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.