tags:

views:

471

answers:

1

My PieChart has a dataTipFunction property

My PieSeries has a labelFunction property

I would like my dataTipFunction to return the same string that my labelFunction returns.

Example, I would like my dataTipFunction to return:

return [whateverMyLabelFunctionReturned] + someExtraStuffThatIAdd

thanks.

A: 

Here is what you do:

This is your label function.

private function myLabelFunction(value:*, a:*, b:*):String {
    return value + 3; //Whatever you return here...
}

This is your datatip function.

private function pieChart_dataTipFunction(item:HitData):String {
    var pSI:PieSeriesItem = item.chartItem as PieSeriesItem;
    var labelResult:String = myLabelFunction(pSI.item.datalabel, null, null);
    return labelResult + " some other text";
}
Gabriel McAdams
Please remember to accept this answer if you found it useful.
Gabriel McAdams