Thanks Brendan>
I think my problem was caused by me specifying a secondDataProvider 
on my LineChart.
Here is a snippet of what worked for me :
My chart is named chLinearChart

var tmpSeriesArrayColl : ArrayCollection;
var ls_P : LineSeries;
var stroke : Stroke;
var tmpFill : LinearGradient;

//Custom ValueObject that holds cahrt data
tmpSeriesArrayColl = ChartDataVO.arrPageByProducerChartData;

for(var k:int = 0; k < tmpSeriesArrayColl.length - 1; k++)
{       
ls_P = new LineSeries();
ls_P.displayName = tmpSeriesArrayColl[k].name; 
ls_P.yField = 'value'; 
ls_P.xField = 'time'; 
//Use the color specified in XML for the stroke
stroke = new Stroke();
stroke.color = tmpSeriesArrayColl[k].color;
stroke.weight = 2;
//My tmpSeriesArrayColl contains a gradient fill I created earlier
tmpFill = tmpSeriesArrayColl[k].fill;
ls_P.setStyle("lineStroke", stroke);
//So the legend dynamically gets the correct color
ls_P.setStyle("fill", tmpSeriesArrayColl[k].color);
ls_P.dataProvider = tmpSeriesArrayColl[k].data; 
this.chLinearChart.secondSeries.push(ls_P); 
}

--- In [email protected], "Brendan Meutzner" 
<[EMAIL PROTECTED]> wrote:
>
> Hey Mike,
> 
> <mx:CartesianChart id="chart"
>                            dataProvider="{_localChartData}"
> secondDataProvider="{_localChartData}"
>                            series="{_firstSeriesArray}"
> secondSeries="{_secondSeriesArray}">
> 
> <mx:Script>
>         <![CDATA[
>             [Bindable] private var _firstSeriesArray:Array;
>             [Bindable] private var _secondSeriesArray:Array;
> 
> 
>             private function createSeries():void
>             {
>                     _firstSeriesArray = new Array();
>                     //LEFT AXIS
>                     var leftSeriesItem:ColumnSeries = new 
ColumnSeries();
>                     leftSeriesItem.yField = "yFieldName";
>                     leftSeriesItem.displayName = "yFieldName";
>                     _firstSeriesArray[0] = leftSeriesItem;
> 
>                         _secondSeriesArray = new Array();
>                         var rightSeriesItem:LineSeries = new 
LineSeries();
>                         rightSeriesItem.yField = "yFieldName";
>                         rightSeriesItem.displayName 
= "yFieldDisplayName";
>                         _secondSeriesArray[0] = rightSeriesItem;
>             }
> 
> ]]>
> </mx:Script>
> 
> 
> Perhaps you're missing the secondDataProvider property?
> 
> 
> Brendan
> 
> 
> 
> 
> On 2/23/07, leds usop <[EMAIL PROTECTED]> wrote:
> >
> >   a code post will help :)
> >
> > --- mgrayfmr <[EMAIL PROTECTED] <mgrayfmr%40yahoo.com>> wrote:
> >
> > > Hey Gang -
> > >
> > > Has anyone had any experience with dynamically
> > > adding a second series
> > > to a chart using actionscript 3.0 ?
> > > Using a LineChart object I have been dynamically
> > > creating new
> > > LineSeries under the linechart's series with no
> > > problem.
> > > I am not having luck adding a second series though.
> > > The data is fine, it just won't display a second
> > > series.
> > > To test, I added my secondSeries data to the primary
> > > series, and it
> > > displays (but realtive to the wrong Y axis,
> > > obviously).
> > >
> > > If anyone has any ideas, I would appreciate it.
> > > If I find a solution, I'll post it here as well.
> > >
> > > Thanks,
> > > Mike
> > >
> > >
> >
> > __________________________________________________________
> > Sucker-punch spam with award-winning protection.
> > Try the free Yahoo! Mail Beta.
> > http://advision.webevents.yahoo.com/mailbeta/features_spam.html
> >  
> >
> 
> 
> 
> -- 
> Brendan Meutzner
> Stretch Media - RIA Adobe Flex Development
> [EMAIL PROTECTED]
> http://www.stretchmedia.ca
>


Reply via email to