Hi Dan,

I don't have any experience with charting components, but is there a way to test if the effects are triggered? Do you need to use an ArrayCollection instead of a plain array to manipulate the series information? I believe this makes a difference with binding-related behaviours.

Cheers,
Lach


On 25/11/2006, at 9:08 AM, daannnb wrote:

Hi All

I'm sorry to post this twice, but still no nearer to a solution, I'm
having a few problems assigning data effects to a dynamically
generated column series, while I can create a new series dynamically
ok, just don't seem to be able to get the showDataEffect to work, a
cut down version of the code that I'm using is below;

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
layout="absolute">
<mx:Script>
<![CDATA[
import mx.controls.CheckBox;
import mx.collections.*;
import mx.charts.*;
import mx.charts.series.*;
import mx.charts.renderers.*;
import mx.charts.events.*;
import mx.events.*;

// the datasource
[Bindable]
public var rs:ArrayCollection = new ArrayCollection([

{label:'Record One', interval1:20, interval2:30, interval3:40},

{label:'Record Two', interval1:37, interval2:56, interval3:41},

{label:'Record Three', interval1:10, interval2:15, interval3:79}]) ;

/**
* Add another column to chart
[EMAIL PROTECTED] Object - the checkbox event
*/
public function appendInterval(column:String):void
{
var series:ColumnSeries = new ColumnSeries() ;
series.xField = 'label' ;
series.yField = column ;
series.setStyle("showDataEffect", slideIn);
series.setStyle("hideDataEffect", slideOut);
var currentSeries:Array = resultchart.series;
currentSeries.push(series) ;
resultchart.series = currentSeries ;
}
]]>
</mx:Script>
<mx:SeriesSlide id="slideIn" duration="1000" direction="up"/>
<mx:SeriesSlide id="slideOut" duration="500" direction="down"/>

<mx:Panel id="holder" title="Result View" width="100%"
height="100%" >
<mx:ControlBar id="resultsControBar" width="100%"
paddingTop="0" paddingLeft="0" paddingBottom="0">
<mx:Spacer width="100%" />
<mx:Label text="Append Interval" />
<mx:CheckBox id="interval1" label="Interval 1"
click="appendInterval('interval1')"/>
<mx:CheckBox id="interval2" label="Interval 2"
click="appendInterval('interval2')"/>
<mx:CheckBox id="interval3" label="Interval 3"
click="appendInterval('interval3')"/>
</mx:ControlBar>

<mx:ColumnChart id="resultchart" dataProvider="{rs}"
width="100%" height="100%">
<mx:horizontalAxis>
<mx:CategoryAxis categoryField="label"/>
</mx:horizontalAxis>

</mx:ColumnChart>
</mx:Panel>

</mx:Application>

Can anyone see what I'm doing wrong? Again, very sorry for the
double post

Regards

Dan

Reply via email to