I have about 4 items on my legend. Its are displayed like this
- bla -bla
- blabal -blabalsd
But it should be displayed like in a table, so it would like this:
- bla____ - blabla
- blablab_- bla
Legend in two columns
I also have the same problem, although the number of columns and rows tend to be more dynamic in nature. I attempted to provide my own instance of LegendTitle using a GridArrangement for arrangement, but I think after setting it all up I simply received an UnsupportedOperationException or something similar.
It is quite possible that I was doing something wrong, but I have considered it a dead-end at the moment. I would be extremely interested if anyone has a workable solution.
It is quite possible that I was doing something wrong, but I have considered it a dead-end at the moment. I would be extremely interested if anyone has a workable solution.
-
- Posts: 1
- Joined: Wed Dec 20, 2006 5:17 pm
I also have this problem -- maybe for xmas....
I also saw the info about getting the legend instance and reformatting it. Where does this code go? I can try to work it out and then post a solution if I'm successful. I'm using jasperreports and iReports to create the chart.
-
- Posts: 6
- Joined: Mon Apr 14, 2008 3:06 pm
Hackish fix idea
I ran into something similar to this, I think my same hackish approach will work. I'm not sure if JFreeChart built in method to make the columns, if it does I would recommend using that.
Basically, what you can do is make every key the same length in characters. So write some code to add trailing white spaces to the end of the keys so they all have the same length (equal to the length of the longest key), before adding them to your dataset.
Basically, what you can do is make every key the same length in characters. So write some code to add trailing white spaces to the end of the keys so they all have the same length (equal to the length of the longest key), before adding them to your dataset.