1 Reply Latest reply on Apr 16, 2010 7:29 AM by Sebastien V.

    Is it feasible ?

    hINTModuleState

      I have developed a control containing a chart.

       

      the code looks like :

       

             <mx:Canvas
                  width="100%" height="100%">
                  <mx:LineChart
                      id="lineChart"
                      width="100%" height="100%"
                      dataProvider="{dataProvider}">
                      <mx:series>
                          
                             
                      </mx:series>
                      <mx:horizontalAxis>
                          <mx:CategoryAxis
                              categoryField="{properties.@categoryField}" />
                      </mx:horizontalAxis>
                  </mx:LineChart>
              </mx:Canvas>

       

       

      At initialization time, I want to be able to add many line series. ie add many <mx:LineSeries> XML nodes inside <mx:series>

       

      Is that possible ?

       

      The situation is that the control will know about its lineSeries only at loadTime. It can't be a precompiled info.

        • 1. Re: Is it feasible ?
          Sebastien V. Level 3

          The LineChart flexdoc tells me that series is an Array, so yes you can do that.

          Just create an Array of LineSeries, and set the LineChart series to this array :

           

          var mySeriesArray     :Array = // do whatever you need to here
          lineChart.series = mySeriesArray;