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"> 

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

5 Comments

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.
The data is from a mysql database that is brought in through php/Zend
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
but how do I access those series in a column chart?
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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.