Search code examples
actionscript-3apache-flexitemrenderercustom-componentpie-chart

Custom Data label for Flex 4 Pie Chart


Does anyone know that it is possible if it is possible to create an item renderer for the data labels of a Flex Pie Chart?

i know it is possible to change the formatting of the String using the label function. But i need more control of the way the data label appears.

The background of the label needs to be a a specific color based on the data.

Thank you in advance for any help you may provide


Solution

  • private function pieSeries_labelFunc(item:Object, field:String, index:Number, percentValue:Number):String {
        //process string and return it 
    }
    

    in your mxml add this hope this will help

    <mx:PieSeries id="pieSeries"
           labelFunction="pieSeries_labelFunc" />
     </mx:series>
    

    Creating custom DataTip renderers

    Refer this link for creating costume tool tip