Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 11-04-2008, 11:36 PM   #1
tsj4
Senior Member
 
Join Date: May 2005
Location: San Francisco
Posts: 741
Default using var to retrieve chartItem data

I have a variable which hold the name of the object I am trying to target in my array collection.

example
ActionScript Code:
var ac:ArrayCollection = new ArrayCollection([{country:"USA", amount:19000}, {country:"JPN", amount:7800  }]) var label:String  = "country";

I need to access this value for my custom dataTipFunction. I have tried this with no success

ActionScript Code:
private function pieDataTipFunc(h:HitData) :String         {            var psi:PieSeriesItem = h.chartItem as PieSeriesItem;            var s:String;                         s = psi.item(label)+"\nTotal Offload : "+decimalToPercentage(Number(psi.value));             return s;         }


Also when I try this it fails

ActionScript Code:
private function pieDataTipFunc(h:HitData) :String         {            var psi:PieSeriesItem = h.chartItem as PieSeriesItem;            var s:String;                         s = psi.item.label+"\nTotal Offload : "+decimalToPercentage(Number(psi.value));             return s;         }

Last edited by tsj4; 11-05-2008 at 08:14 AM.
tsj4 is offline   Reply With Quote
Old 11-05-2008, 06:11 PM   #2
tsj4
Senior Member
 
Join Date: May 2005
Location: San Francisco
Posts: 741
Default

if this is not possible what would the equiv to xFeild and yFeild of xValue or yValue be since a pie chart does not use these properties?

such as
ActionScript Code:
PieChartItem(hitData.element).field PieChartItem(hitData.element).nameField
tsj4 is offline   Reply With Quote
Old 11-05-2008, 10:05 PM   #3
tsj4
Senior Member
 
Join Date: May 2005
Location: San Francisco
Posts: 741
Default

Ok, both example of what I was trying are clearly wrong since I should be using the hitData info.

I have modified the attempts to reflect a more accurate approach but still with no success.
ActionScript Code:
var ac:ArrayCollection = new ArrayCollection([{country:"USA", amount:19000}, {country:"JPN", amount:7800  }]) var label:String  = "country"; private function pieDataTipFunc(h:HitData) :String {    var psi:PieSeriesItem = h.chartItem as PieSeriesItem;    var s:String;    s = h.item.label+"\n"+"Total Offload : "+decimalToPercentage(Number(psi.value));                      return s; }


The part in question is
ActionScript Code:
h.item.label
tsj4 is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help simplifying repeating code addChild_tim ActionScript 3.0 6 07-23-2008 04:52 PM
Slideshow / FLV Player Problems interfacer ActionScript 3.0 1 05-06-2008 10:54 PM
Flash Remoting Problem With Cold Fusion shoalinwu Flash Remoting 0 05-02-2008 08:55 PM
Migrate this Code To AS3 fabio_c ActionScript 3.0 6 02-13-2008 07:35 PM
Tweens, button states, overall advice. dev.null ActionScript 3.0 0 01-13-2008 04:39 AM


All times are GMT. The time now is 12:24 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.