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

Message ListMessage List     Post MessagePost Message

  Set Multicolor to the Xaxis labels
Posted by Kris on May-29-2009 18:42
Hai Peter

I need to set different colors to Xaxis labels.

ScatterLayer.setDataLabelStyle().setFontColor(0xff3333);

if(label[i].equalsIgnorecase("teststring")
{
// m setting different color.
}
else
{
//other color
}
But all my labels are updated with one color.


Thanks & Regards
Kris

  Re: Set Multicolor to the Xaxis labels
Posted by Peter Kwan on May-29-2009 23:18
Hi Kris,

You may use CDML to control the color of individual label (and even part of the label). (You may look for CDML in the ChartDirector documentation index).

For example:

//default color is red
myLayer.setDataLabelStyle("Arial", 10, 0xff3333);

//set some labels to green
for (int i = 0; i < labels.length; ++i) {
    if (label[i].equalsIgnorecase("teststring"))
         labels[i] = "<*color=00CC00*>" + labels[i];
}

Hope this can help.

Regards
Peter Kwan