0

I have a chart and am trying to display the "volume" in a line chart as the primary series & the "temp" as a column chart as the secondary series...(the "compound" will be shown in the datatip):

[{date=Tue Feb 08 19:00:00 EST 2011, volume=1200, 1={temp=-50, compound=helium}, 0={temp=-45, compound=oxygen}}]

I can get the "volume" series to display fine, but cannot get the "temp" series to display...how do I access them? Right now I have:

<mx:ColumnSeries id="secondSeries" xField="date" yField="temp"> 
Cornel Creanga
  • 5,311
  • 1
  • 22
  • 28
user_78361084
  • 3,538
  • 22
  • 85
  • 147

1 Answers1

1

i don't know which datatpype your Object is.

I use an Array for example. Check this Code:

<fx:Script>
        <![CDATA[

            private var obj:Array = [{date:"Tue Feb 08 19:00:00 EST 2011", volume:"1200", 1:{temp:"-50", compound:"helium"}, 0:{temp:"-45", compound:"oxygen"}}];


            private function onInit() :void
            {
                trace (obj[0].date);
                trace (obj[0][1].temp);

            }
        ]]>
    </fx:Script>

Let me know, if you're using another Datatype.

BR Frank

Frank
  • 780
  • 1
  • 10
  • 22
  • well, I need it to be dynamic because the number of "temps" and "compounds" will vary...sometimes I will have 2 (as in the example above), sometimes I'll have 20 & sometimes none. – user_78361084 Feb 14 '11 at 13:05
  • The data is from a mysql database that is brought in through php/Zend – user_78361084 Feb 14 '11 at 13:06
  • the dynamic comes from a for loop depend on obj.[0][1].length for a script solution. However, a barchart should draw each object dynamically. If you need more info, please let me know. But please post more code – Frank Feb 14 '11 at 13:59
  • but how do I access those series in a column chart? – user_78361084 Feb 22 '11 at 12:38
  • Hi User522962, as i wrote, please post more code. I need to know, what a datatype you use as dataprovider. After that, i can post an example. BR Frank – Frank Feb 23 '11 at 20:51