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.

[More]

TweetBacks
Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
I have been looking for a solution for this problem and was just about to go down to the custom tooltip road so glad i have foun this.

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
# Posted By noel noegdip | 3/29/11 8:07 PM
The code assume you want to display a tooltip.

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;
   }
}
# Posted By Justin Mclean | 3/29/11 8:24 PM
After doing following change it worked for me.

if (label == '' || label == null)
{
if(nopoints == 1)
   dataPoints = [];
else
   dataPoints.splice(i,1);
}
# Posted By Anil Sharma | 1/18/13 5:57 PM