legend « Dataset « JFreeChart Q&A

Home
JFreeChart Q&A
1.Axis
2.BarChart
3.Chart
4.Color
5.Component
6.Dataset
7.Development
8.GanttChart
9.Graph
10.Image
11.Interoperability
12.Label
13.Layout
14.Legend
15.LineChart
16.PieChart
17.Plot
18.Renderer
19.Series
20.ToolTip
21.XYLineChart
JFreeChart Q&A » Dataset » legend 

3. 2 datasets with the same legend    jfree.org

try this: LegendTitle leg_title1 = new LegendTitle(plot.getRenderer(0)); leg_title1.setMargin(new RectangleInsets(2, 2, 2, 2)); leg_title1.setBorder(new BlockBorder()); leg_title1.setBackgroundPaint(Color.WHITE); LegendTitle leg_title2 = new LegendTitle(plot.getRenderer(1)); leg_title2.setMargin(new RectangleInsets(2, 2, 2, 2)); leg_title2.setBorder(new BlockBorder()); leg_title2.setBackgroundPaint(Color.WHITE); BlockContainer container1 = new BlockContainer(new BorderArrangement()); container1.add(leg_title1, RectangleEdge.LEFT); BlockContainer container2 = new BlockContainer(new BorderArrangement()); container2.add(leg_title2, RectangleEdge.RIGHT); CompositeTitle comp_title_1 = new CompositeTitle(container1); CompositeTitle comp_title_2 = new CompositeTitle(container2); comp_title_1.setPosition(RectangleEdge.BOTTOM); comp_title_2.setPosition(RectangleEdge.BOTTOM); chart.addSubtitle(comp_title_1); chart.addSubtitle(comp_title_2);

4. Trying to create custom Legend with Values from dataset    jfree.org

This feature is not available in JFreeChart (I inquired about it a couple years ago). You could use a JTable to display the table below the frame. It is fairly easy to write a TableModel that queries the dataset and populates the table. The 'legend' is easily accomplished via a custom TableCellRenderer which queries the legend information from the plot. If ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.