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

Message ListMessage List     Post MessagePost Message

  Displaying a substring of {label}
Posted by phil1308 on Oct-12-2012 21:15
Hello everyone.
I'm using ChartDirector under myDBR.
I would like to format the {label} displayed oj my pie chart.
On the chart I would like to display a sort of "substring({label}, 0, 2)" whereas on the
legend the full {label} will be displayed !

How it is possible ?
I didn't find the way to do this...

Thank you in advance.

  Re: Displaying a substring of {label}
Posted by Peter Kwan on Oct-13-2012 02:48
Hi phil1308,

You may use two arrays, one for the labels in the legend box, and one for the sector labels. The code is like:

$c->setData($myData, $arrayOfLegendLabels);
$c->addExtraField($arrayOfSectorLabels);

#use the extra field as the sector labels
$c->setLabelFormat("{field0}\\n{percent}%");

Hope this can help.

Regards
Peter Kwan