cancel
Showing results for 
Search instead for 
Did you mean: 

DrillDown Flash Chart

Former Member
0 Kudos

After having success building simple charts I've been trying lately to implement a more complex chart. It's a DrillDown Chart with a click event that changes the displayed data based on the column that was clicked. Here is the working Adobe example: http://livedocs.adobe.com/flex/3/html/help.html?content=charts_eventsandeffects_11.html (It's the bottom chart).

The data in the example is hard coded and I wasn't able to find a way to make it bindable. I think I should create an ArrayCollection with a DrillDown structure that will be dynamic, that I can populate during the run of the Web Dynpro program. The other option might be to use the click event to somehow change the data based on the specific column that was clicked.

If anyone has implemented something like this, or has any thoughts/ideas of what should be the correct approach, I would love to hear, even if it's very general. Reading-suggestions that are relevant will be appreciated as well.

Thanks,

Yoni,

Edited by: Uzan Yoni on Jun 3, 2010 8:33 AM

Edited by: Uzan Yoni on Jun 3, 2010 8:34 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I only got one series, so I already know what series was clicked. Question is what it the exact item in that series that was clicked. I have a column chart with 1 series, 6 entries. I want to know which one of the 6 was clicked.

Former Member
0 Kudos

Hello,

You can use itemClick event of the Column Chart. In the event handler for that event, you will receive an event object of ChartItemEvent. Here

event.hitData.item will correspond to the item which is clicked. And you can access any of the attributes/properties of item using that.

Here is a sample code:


//data provider for chart
     [Bindable]
     public var dataSet:ArrayCollection = new ArrayCollection([
        {Month:"Jan", Expenses:1500},
        {Month:"Feb", Expenses:200},
        {Month:"Mar", Expenses:500}
     ]);

     public function myHandler(e:ChartItemEvent):void {
        Alert.show("Chart data was clicked"+ e.hitData.item.Month); 
     }

Hope this helps!

Regards,

Srilatha

Former Member
0 Kudos

Beatuful! thanks a lot!

Do you know if one of the attributes I get for the item is the index number of that item in the series? This way, I could know that index 2 is week 2, index 4 is week 4, etc, etc...

Getting the value of the week, for exmaple "142009", is less helpful, unless I can send this value to the Web Dynpro component.

Edited by: Uzan Yoni on Jun 3, 2010 11:43 AM

Former Member
0 Kudos

If you need the index number of the item which is clicked, use event.hitData.chartItem.index

And as you may know, index is zero based( starts from 0)

Regards,

Srilatha

Edited by: Srilatha M on Jun 3, 2010 11:57 AM

abhimanyu_lagishetti7
Active Contributor
0 Kudos

Hi

use itemClick="myHandler(event) of the ColumnChart

event is of type ChartItemEvent, inside event.hitdata.item.date will have the date.

event.hitdata.chartitem.index will have the index.

Former Member
0 Kudos

Thanks a lot!

Former Member
0 Kudos

One more thing, Is there any way to pass the properties of the Hitdata to the Web Dynpro component? Maybe through a Variable?

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

I would think you would pass the properties back as an event parameter. You can pack data into the FlashIslands events:

FlashIsland.fireEvent(this,"newDirections",{dirString:dirS});

The third importing parameter of the fireEvent function in FlashIsland library is for passing event parameters. You can access these parameter via the WDEVENT importing parameter of your Web Dynpo Event Handler.

Answers (1)

Answers (1)

abhimanyu_lagishetti7
Active Contributor
0 Kudos

Let's make it simple, onClick event call an event in ABAP fetch the new series in to another array collection and bind it to the chart dynamically as in zoomIntoSeries method of the example

Thanks

Abhi

Former Member
0 Kudos

But in order to know what data to fetch, I need to know which of the columns was clicked. I have a column for each week, and I want to show daily data for that given week when the user clicks it. So if I create an event in Flex, and attach it to the "on click" of the series, when the user clicks any column the event is triggered but I can't know weather it was week 1 or 3 or 6 that was clicked. Or can I? If I know I always have 6 and only 6 weeks, Is there any way to use the index of the column?

abhimanyu_lagishetti7
Active Contributor
0 Kudos

In the Event e, currentTarget is the Column series. There is a attribute called ID which gives you the id of the series.

try - e.currentTarget.id

Thanks

Abhi