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

 All Forums
 Tools for Java
 QCChart2D for Java
 Legend Font and Symbol Size
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

RunnerGirl

6 Posts

Posted - 10 Apr 2008 :  16:03:06  Show Profile  Reply with Quote
Is there a way to make the symbol for the legend larger? I have tried ChartAttribute.setSymbolSize() but it does not seem to have any effect.

Also, can I set the legend/legend font to not resize on window resizing?

Thanks.

quinncurtis

1164 Posts

Posted - 10 Apr 2008 :  17:13:30  Show Profile  Reply with Quote
We tested the following code and it worked fine.

ChartAttribute largeSymbol = new ChartAttribute(Color.yellow, 1, 0, Color.yellow);
largeSymbol.setSymbolSize(18);
StandardLegend legend = new StandardLegend(0.2, 0.15, 0.3, 0.4, legendAttributes, StandardLegend.VERT_DIR);
legend.addLegendItem("Forecast",ChartConstants.HBAR, largeSymbol, legendFont);


You can also changed the size of a legend item using code similar to:

// Change the size of the symbol of the first legend item (index 0) to 18
legend.getLegendItem(0).getLegendItemSymbol().setSymbolSize(18);


You cannot selectively have the legend not resize. You can either have all of the text in the chart automatically resize (axis labels, titles, legends, etc.) or not resize. Use the ChartView setResizeMode method. But you can't mix and match.

gWG.setResizeMode(ChartConstants.NO_RESIZE_OBJECTS);

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