I have a line chart with a column chart as a secondary series. When I roll over the line, the datatips appear. However, if I move the mouse to a spot where a column appears while still on the line, the data tip item appears for the line AND the column. How do I get it so that I only show datatips for the line but not the column?
<mx:AreaChart id="areachart" dataProvider="{data}" showDataTips="true" >
<mx:series>
<mx:AreaSeries id="areaSeries" xField="date" yField="volume" >
</mx:AreaSeries>
<mx:ColumnSeries id="secondSeries" xField="date" yField="name" >
</mx:ColumnSeries>
</mx:series>
</mx:AreaChart>
Subclass AreaChart and override findDataPoints method to filter out the data points you don't want:
public class CustomAreaChart extends AreaChart
{
public override function findDataPoints(x:Number, y:Number):Array
{
var originalDPs : Array = super.findDataPoints(x, y);
var filteredDPs : Array = [];
for each (var hd : HitData in originalDPs)
{
if (hd.chartItem.element is AreaSeries)
filteredDPs.push(hd);
}
return filteredDPs;
}
}
And then use this new class instead of AreaChart.
Alternatively you can set the interactive property of the column to false:
<mx:ColumnSeries id="secondSeries" xField="date" yField="name" interactive="false">
</mx:ColumnSeries>
This will prevent the columns from responding to mouse input.