Controlling tooltip display in a Flex PlotChart
Tooltips are a great feature of the Flex charting components but it's an all or nothing affair either all your points display them or none of them do. Here a way so only the points you decide show tooltips when you mouse over them.
TweetBacks
However, I can't seem to get it to work I have a datatipfunction that just returns '' as a test but I still get an empty box. Do you have a working example so I can check I have not missed anything out?
Thanks
If you want to stop blank tooltips from showing you need to go a little bit further:
1. Add an itemRollOver handler to the chart.
2. In that handler set showDataTips to true or false depending on if you have any points to display (event.hitSet.length).
Something like (off the top of my head not tested):
private function checkDataTip(event:ChartItemEvent):void {
if (event.hitSet.length > 0) {
(event.currentTarget as PlotChart).showDataTips = true;
}
else {
(event.currentTarget as PlotChart).showDataTips = false;
}
}
if (label == '' || label == null)
{
if(nopoints == 1)
dataPoints = [];
else
dataPoints.splice(i,1);
}