Position of legend
Position of legend
The default legend position is a horizontal layout at the bottom of the plot. Is there a way to change this to a vertical layout at the right of the plot?
Re: Position of legend
Lou,
If you get the Legend from the JFreeChart, you can change it's position using the setAnchor() method. Something like this:
JFreeChart chart;
...
Legend legend = chart.getLegend();
legend.setAnchor(Legend.EAST);
Use NORTH, SOUTH, WEST from the Legend class to choose other positions on the chart.
Don
If you get the Legend from the JFreeChart, you can change it's position using the setAnchor() method. Something like this:
JFreeChart chart;
...
Legend legend = chart.getLegend();
legend.setAnchor(Legend.EAST);
Use NORTH, SOUTH, WEST from the Legend class to choose other positions on the chart.
Don