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

Message ListMessage List     Post MessagePost Message

  Scatter chart axis in red for negative and box for label
Posted by Haim on Sep-26-2012 01:08
Hello
I have scatter chart and have 2 questions
1. I need to make one of data labels to have border around  , how I can achieve it?
I was able to make unique color for each data label using CDML <*font color..... *>, but have no idea how to make border around one data labels ( I need border only around 1 data label)

2.for same chart I need to make y-axis labels in red if they negative.

thanks

  Re: Scatter chart axis in red for negative and box for label
Posted by Haim on Sep-26-2012 02:39
I sold problem #1 using CDML <img ..*>
need help with problem #2
thanks

  Re: Scatter chart axis in red for negative and box for label
Posted by Peter Kwan on Sep-26-2012 04:59
Hi Haim,

For #1, in ChartDirector 5.1, there is a CDML attribute "edgeColor" that can be used to set the border color of the text. You may also use the "margin" attribute to set the margin between the border and the text. For example:

<*block,edgeColor=000000,margin=3*>XXXXX<*/*>

Another method is to use Layer.addCustomDataLabel to add a custom data label to a data point as a separate TextBox. You can then set the TextBox border. It is like:

$t = $layer->addCustomDataLabel(.....);
$t->setBackground(Transparent, 0x000000);

For #2, I can think of several methods. The simplest one I can think of is to use a y-zone color as the label color. It is like:

$c->yAxis->setLabelStyle("arialbd.ttf", 8, $c-yZoneColor(0, 0xff0000, 0x000000));

However, the above will make the 0 digit half red, and half black. So we need to use addMark to force it to black:

$c->yAxis->addMark(0, -1, "0")->setMarkColor(0xcccccc, 0x000000, 0x000000);

Hope this can help.

Regards
Peter Kwan

  Re: Scatter chart axis in red for negative and box for label
Posted by Haim on Sep-26-2012 05:09
Peter, thank you very much!
works perfectly!