I would like to a a title to a legend. I have looked through the API but I cannot figure it out.
The LegendTitle class has a BlockContainer object to hold the legend items, and also possibly a BlockContainer wrapper. I could add a TextTitle to one of those BlockContainers, but how do I specifier that it should be centered at the top?
This answer on StackExchange gives a solution, but it seems a bit like a lucky guess. Is this really the way to do it?
How to add a title to a Legend
-
- Posts: 1634
- Joined: Sat Feb 17, 2007 1:51 pm
Re: How to add a title to a Legend
You can extend LegendTitle and override the fetchLegendItems method. Modify the method that first a LabeBlock with the desired text is added, and then the regular item blocks.
The alignment might be harder to implement. The Arrangement classes FlowArrangement and ColumnArrangement contain a couple of ToDos, most of tem in relation to the horizontal and vertical alignment.
The alignment might be harder to implement. The Arrangement classes FlowArrangement and ColumnArrangement contain a couple of ToDos, most of tem in relation to the horizontal and vertical alignment.