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

Message ListMessage List     Post MessagePost Message

  use of {x} as index to array inside setAggregateLabelFormat
Posted by Richard on Feb-05-2022 05:21
Hi,
assuming that I have defined an array of integers called $data4[], can I used the {value} or {x} fields as indexes into that array while using setAggregateLabelFormat for a stack-bar chart?

Something like this?

$layer->setAggregateLabelFormat("{=$data4[={x}]  }");


I've tried numerous permutations but can't quite find the correct syntax.

Thanks!
Richard

  Re: use of {x} as index to array inside setAggregateLabelFormat
Posted by Peter Kwan on Feb-06-2022 18:13
Hi Richard,

For your case, the following are some options:

(a) You can just tell ChartDirector what label you want to display on each stacked bar by adding $data as an extra field:

$layer->addExtraField($data4);
// Use the extra field as the aggregate label
$layer->setAggregateLabelFormat("{field0}");


(b) You can use Layer.addCustomAggregateLabel in a loop to specify the labels.


Regards
Peter Kwan