how to show one legend item per row in legend area?
for example:
—— legend text1
—— legend text2
—— llegend text3
—— llegend text4
how to show one legend item per row in legend area?
Use the following code to change the positioning of the legend from the bottom to the right side (or you could do the LEFT side).
This has the effect of ordering the legend items in a vertical rather than a horizontal alignment. To my knowledge, you can't leave the legend on the bottom AND align them vertically.
This has the effect of ordering the legend items in a vertical rather than a horizontal alignment. To my knowledge, you can't leave the legend on the bottom AND align them vertically.
Code: Select all
LegendTitle legend = (LegendTitle) chart.getSubtitle( 0 );
legend.setPosition( RectangleEdge.RIGHT );
Actually, I was faced with the same problem as you, but I also had to deal with the possibility of up to 20 series.
I resolved it by doing two things:
1. I decided to keep the legend short, and moved it to the right side.
2. I put the chart in a tabbed pane, then in a second tab, I provided a table listing more detailed info about each series in the legend/chart. For my application, I also provided some editable info in the table that auto-updated in the chart.
I resolved it by doing two things:
1. I decided to keep the legend short, and moved it to the right side.
2. I put the chart in a tabbed pane, then in a second tab, I provided a table listing more detailed info about each series in the legend/chart. For my application, I also provided some editable info in the table that auto-updated in the chart.
the legend item show as follow:
—— legend text1 max: maxvalue avg: avgvalue cur: curvalue
—— legend text2 max: maxvalue avg: avgvalue cur: curvalue
so, not to keep the legend short. my project is web project,it is urgent to make me temporarily to give up the effect of ordering the legend items in a vertical rather than a horizontal alignment.
thank you very much for your help again.
—— legend text1 max: maxvalue avg: avgvalue cur: curvalue
—— legend text2 max: maxvalue avg: avgvalue cur: curvalue
so, not to keep the legend short. my project is web project,it is urgent to make me temporarily to give up the effect of ordering the legend items in a vertical rather than a horizontal alignment.
thank you very much for your help again.
If you need to keep the legend on the bottom, then one way to accomplish your goal is to make each legend item long enough so that only one item fits on a single line.
The legends are ordered left-to-right, as many as fit on a line before wrapping to the next line. If you add even more length to your legend items, then you could force them one on a line.
I believe the items would be left-justified on each line rather than centered however.
The legends are ordered left-to-right, as many as fit on a line before wrapping to the next line. If you add even more length to your legend items, then you could force them one on a line.
I believe the items would be left-justified on each line rather than centered however.