Author |
Topic  |
|
Peter
17 Posts |
Posted - 10 Jun 2010 : 17:49:43
|
I'm using the ScatterPlot3D demo as a template for a prototype.
My plot has ~3600 points in 43 individual datasets. That means the legend gets pretty big (almost as big as the plot itself).
I first used the legend constructor from the demo: StandardLegend legend = new StandardLegend(0.3, 0.875, 0.6, 0.075, legendAttributes, StandardLegend.HORIZ_DIR);
but found that this threw an exception rendering the legend when I had more than 8 datasets plotted (from the error messages, I surmised that there wasn't enough room in the legend to accommodate more than 8 legend items).
So I explicitly set setAutoSizeLegendRectangle(true); to no avail (still threw the same exception).
Then I tried a different constructor: StandardLegend legend = new StandardLegend(0.1, 0.6, legendAttributes, StandardLegend.HORIZ_DIR);
This worked insofar as the code didn't choke, but the legend, which now holds all 43 dataset legend items, locates itself partially on top of the plot itself. If I give it a slightly larger ry value in the constructor for StandardLegend, it goes back to throwing the same exception.
It seems to be an issue with the percentage of the ChartView that the plot vs legend are taking up. In this case, the legend needs a larger percentage of the ChartView than the default but I haven't found a way to set this...
Is there a way to let the plot and legend come to some spacial agreement on their own? I have to be able to plot from 1 to n datasets. |
|
quinncurtis
1164 Posts |
Posted - 10 Jun 2010 : 21:03:23
|
43 does seem to be an incredible number of legend items. Where do you want the legend placed: left, right, top, bottom ? What are the SetGraphBorderDiagonal values for your plot. |
 |
|
Peter
17 Posts |
Posted - 14 Jun 2010 : 12:07:39
|
Yeah, 43 legend items is crazy. I support high energy physics research--the magnitude of the numbers I'm dealing with are nuts too--on the order of 10E25. 
Your pointing out the call SetGraphBorderDiagonal did it.
Thanks!  |
 |
|
|
Topic  |
|
|
|