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

Message ListMessage List     Post MessagePost Message

  Multi-Color Labels
Posted by Anneliese on Jul-30-2011 01:01
Is there a way to make labels different colors? I want to make the last label in my label
array blue and have the remaining labels black. I tried the following code (php) but it
simply overwrites the first part and uses only the black $remainingLabels.

$chart->xAxis->setLabelStyle($fontPath, 10, 0x7295dc)->setMaxWidth(240);
$chart->xAxis->setLabels(end($labels));
$chart->xAxis->setLabelStyle($fontPath, 10)->setMaxWidth(240);
$remainingLabels = array_slice($labels,0,-1);
$chart->xAxis->setLabels($remainingLabels);

Thanks,
Anneliese

  Re: Multi-Color Labels
Posted by Peter Kwan on Jul-31-2011 02:49
Hi Anneliese,

You may use CDML to achieve what you want.

Suppose your x-axis labels are ("aaa", "xyz", "123", "pqn"), and you want the last label "pqn" blue, and all other labels black, please use "<*font,color=7295dc*>pqn" as the last label. (In other words, insert "<*font,color=7295dc*>" in front of the label.)

You may refer to the documentation on CDML (you may look for "CDML" from the ChartDirector documentation index) for more details.

Hope this can help.

Regards
Peter Kwan

  Re: Multi-Color Labels
Posted by Anneliese on Aug-02-2011 04:32
Thanks! That worked great!