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

Message ListMessage List     Post MessagePost Message

  Adding text relative to chart coordinates
Posted by Pete DeLine on May-13-2011 18:29
I would like to add a text label to an XYChart at a specific x/y coordinate rather than x-pixel/y-pixel position. Is this possible?

  Re: Adding text relative to chart coordinates
Posted by Peter Kwan on May-14-2011 03:03
Hi Pete,

If you would like to add text to a particular (x, y) data value coordinate, you may add a scatter layer with just one point at (x, y). The scatter layer can use a transparent symbol. Then attach the label to that symbol.

For example:

layer = c.addScatterLayer([x], [y], "", ChartDirector::DiamondSymbol, 1, ChartDirector::Transparent, ChartDirector::Transparent)
layer.addCustomDataLabel(0, 0, "My Label", "arialbd.ttf", 8, 0x000000).setAlignment(ChartDirector::Center)

Hope this can help.

Regards
Peter Kwan