Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Save Password
Forgot your Password?

 All Forums
 Tools for Java
 QCChart3D for Java
 legend positioning problem
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  


17 Posts

Posted - 10 Jun 2010 :  17:49:43  Show Profile  Reply with Quote
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.


1563 Posts

Posted - 10 Jun 2010 :  21:03:23  Show Profile  Reply with Quote
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.
Go to Top of Page


17 Posts

Posted - 14 Jun 2010 :  12:07:39  Show Profile  Reply with Quote
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.

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-2018 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07