0
votes

I am developing a chart in the flex and i want to have customized legend labels. Customized in the sense that if i bind certain data source to the chart then it will show x axis labels into the legends by default.

So for example,

By default it shows legends like this : 2011, 2012, 2013

How i want to make them display is : 2011 ( 30% ), 2012 ( 40%), 2013 ( 12.45%) and so on.

I googled my problem but was not able to get the exact solution what i was looking for. Can anyone please tell how can i achieve this thing?

1
What is the data format, to which you are binding your Chart control ? - Chetan Sachdev
Refer to this link.. livedocs.adobe.com/flex/3/html/…, see the displayName property - Chetan Sachdev
@ChetanSachdev : i am using amf data format and i have already reffered this link. It doesn't help me. I hope you are clear with the question. I need to customize the labels that are given in the legend. In my case i cannot directly add series into the chart via mxml. It is coming from the actionscript. - Ankur Trapasiya
Can you paste a sample of your dataprovider and a screenshot to give more clarity.. - Chetan Sachdev
I would look at the Legend class, in particular there is a private method addLegendItem() at line 6081 (WTF, 6000+ lines for this "simple" object!?). In this method it is receiving some chart object from the chart and getting the label. If you run this through the debugger, I'm guessing you can find some way to get the percentage and add it to the label (on line 6087). I'd do this, but you haven't provided any code (ie: what kind of chart, etc) so I'm not going to bother guessing at what that "some chart object" is and what your data looks like. - Sunil D.

1 Answers

0
votes

It seems it is not possible to do so.