Unfortunately, the data property in a chart itemRenderer, only contains
the xField and the yField; because it is a ChartItem. However, assuming
that both series relate to each other by a common xValue, you could use
that to iterate over the first series dataProvider to get the related
item; assuming that the dataProvider is public and hopefully in a model.
private var _chartItem:ChartItem;
public function get data():Object {
return _chartItem;
}
public function set data(value:Object):void {
if (_chartItem == value) return;
_chartItem = ChartItem(value);
if(_chartItem != null)
if (ColumnSeriesItem(_chartItem).xValue != null)
var myCommonXValue : String =
ColumnSeriesItem(_chartItem).xValue.toString();
// then loop through the first series
dataProvider, comparing the xValue, to get the associated sales value
}
-TH
--- In [email protected], Laurent Cozic <[EMAIL PROTECTED]> wrote:
>
> Normally, the way to pass parameters to the item renderer is through
its "data" property. So just make sure that your data provider contains
whatever information you need to set the item renderer position.
>
> -- Laurent Cozic
>
>
> Flash, Flex and Web Application development
> http://pogopixels.com
>
>
>
> ----- Original Message ----
> From: chigwell23 [EMAIL PROTECTED]
> To: [email protected]
> Sent: Thursday, July 31, 2008 4:33:54 PM
> Subject: [flexcoders] Chart: pass info about series1 to series2
lineSegmentRenderer callback?
>
>
> First question is whether I can pass actual parameters to a callback
> in the first place? This is what I need to do:
>
> <mx:ColumnSeries id="salesSeries"
> yField="sales" >
> </mx:ColumnSeries>
>
> <mx:LineSeries id="percSeries"
> yField="percent"
> lineSegmentRenderer ="PercentLineRen derer("orig callback params",
> "new callback params")">
> </mx:LineSeries
>
> Conventionally of course the lineSegmentRenderer gets no params as a
> callback. But in this instance I need to manipulate the position of
> the "percent" line series lines through the renderer based on "sales"
> series data so that the lines are positioned exactly over the columns
> of the "sales" series". I have code in the renderer that positions the
> lines, but different underlying data for the column series (2 side by
> side cols for each data point), changes the width and horizontal
> position of the columns and then the "percent" line fragments above no
> longer line up.
>
> If I could get the "sales" series info to the "percent series
> "renderer" I think I stand a chance of coding "interacting series"
>
> A big thank you in advance,
>
> Mic.
>