ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Title for the legend
Posted by Andreas Eriksson on Mar-29-2011 21:49
Hi!

Two questions:


Question1:
Is it possible to get a title just over the legend?
Like this:

Outcomes:
Outcome1   Outcome2   Outcome3



Question2:
Is it possible to change the symbols for the legends?
Im using addLineLayer(...) for getting regular lyaers. The default symbol for the layers in the legend seems to be squares with a black border.
Is it possible to change this? I want to have circles with NO borders.


Thank you for a very nice library for Java.

Best regards
//Andreas

  Re: Title for the legend
Posted by Peter Kwan on Mar-30-2011 02:55
Hi Andreas,

(1) Yes. Just add the text on top of the legend. For example:

c.addLegend(50, 30, false); //legend box is at (50, 30)

//add the text bottom left aligned to (50, 30)
c.addText(50, 30, "Outcomes", "Arial Bold", 10, 0x000000, Chart.BottomLeft);

(2) To insert an legend entry with a symbol, you may disable default legend entry for the bar layer, and add another empty scatter layer with the symbol you want. For example:

myBarLayer.setLegendOrder(Chart.NoLegend);
c.addScatterLayer(null, null, "ABC XYZ", Chart.CircleShape, 13, 0xff3333, 0xff3333);

Hope this can help.

Regards
Peter Kwan

  Re: Title for the legend
Posted by Andreas Eriksson on Mar-30-2011 15:37
It gave exactly the outcome that I wanted.
Thank you!
//Andreas