Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Tools for Java
 QCChart3D for Java
 legend positioning problem

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List

* Forum Code is ON
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]


T O P I C    R E V I E W
Peter 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.
2   L A T E S T    R E P L I E S    (Newest First)
Peter 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.

quinncurtis 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.

Quinn-Curtis Forums © 2000-2018 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07