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

Message ListMessage List     Post MessagePost Message

  Pu text on 4 corners of chart..~
Posted by ilharess on Jan-19-2009 16:43
Hi..

I was wondering is there a way to put text on all 4 corners of a chart in a scatter diagram.. And how do I put arrows and labels for each symbols in the scatter diagram..

Thanx in advance..

Regards,
ilharess

  Re: Pu text on 4 corners of chart..~
Posted by Peter Kwan on Jan-20-2009 03:35
Hi iharess,

You may use BaseChart.addText to put labels on anywhere you like in the chart. For example, to put a label on the top left corner, use:

c.addText(0, 0, "This is my Text", "Arial Bold", 12);

To put a label on the top right corner, use:

c.addText(0, myChartWidth - 1, "ABC DEF GHI", "Arial Bold", 12).setAlignment(cd.TopRight);

To put a label on each symbol, use:

//assume layer = your scatter layer object
layer.addExtraField(myArrayOfLabels);
layer.setDataLabelFormat("{label}");

You may use Layer.setDataLabelStyle to configure the font size, color, alignment, etc., of your labels.

For arrows, it depends on exact what you mean by an arrow. A text label can also contain an arrow, like "--->". Many fonts contain special characters that are arrows. (Eg. use the Windows Character Map to look at the Arial font. the character for U+2190 to U+21A8 are all arrows.) You may also add another scatter layer using arrows as the symbols, or add a vector layer, etc..

Hope this can help.

Regards
Peter Kwan