Here you go...

private function myDataTipFunction( e:HitData ):String {
var obj:Object = e.chartItem;
if (e.chartItem is ColumnSeriesItem) {
...your columnSeries code here
} else {
...your lineSeries code here
}

-Eddie


--- In [email protected], "Amy" <[EMAIL PROTECTED]> wrote:
>
> --- In [email protected], "sailorsea21" <sailorsea21@> 
> wrote:
> >
> > Hi Amy, 
> > My graph is a multiple series (Column and Line).
> > I successfully modified the column series datatip but my line 
> series 
> > data tip is now giving me an error:
> > 
> > "Type Coercion failed: cannot convert 
> > mx.charts.series::[EMAIL PROTECTED] to 
> > mx.charts.series.ColumnSeries."
> > 
> > How can I have another function for my LineSeries data tip?
> > 
> > This is my script:
> > 
> > public function myDataTipFunction(e:HitData):String 
> > {
> > var columnValue:String;
> > var value:String;
> > var yF:String = ColumnSeries(e.element).yField;
> >                 
> > if (yF == "importations")
> > {
> > columnValue = ColumnSeries(e.element).displayName + "\n" + 
> > e.item.period + "\n" + numberFormatter.format
(e.item.importations);
> > value = columnValue;
> > }
> > else if (yF == "finalises")
> > {
> > columnValue = ColumnSeries(e.element).displayName + "\n" + 
> > e.item.period + "\n" + numberFormatter.format(e.item.finalises);
> > value = columnValue;
> > }
> > return value;
> > }
> 
> 
> There should be a more generic type that both series types inherit 
> from that you could use.  If not, try casting it both ways and 
having 
> alternate paths for each.
> 
> HTH;
> 
> Amy
>


Reply via email to