1 Reply Latest reply on Sep 13, 2006 8:16 PM by Xeal

    Custom Data Tips in Column Chart

    upshotvideo
      Hello,
      I'm trying to get my columnChart data tips to display a custom dataTip, but its not working. Im use DataTipFunction,importing the appropriate class, and writing this function:

      public function columnToolTip(e:ChartItemEvent):String{
      var d:String = "test" + e.hitData.item.day;
      return d;
      }
      This is exactly how it is the help files, but I get an error on rollover:
      TypeError: Error #1034: Type Coercion failed: cannot convert mx.charts::HitData@3077c81 to mx.charts.events.ChartItemEvent.

      I also copied the example from the help and pasted into a test app, and I get the exact same error.
      Any ideas? The help example i used is from the first result when searching for "dataTipFunction".
      Thanks
        • 1. Re: Custom Data Tips in Column Chart
          Xeal
          The help is wrong. Or, if the help is right, the implementation is wrong :)

          In the actual implementation, dataTipFunction expects a HitData parameter, not a ChartItemEvent. So your code becomes:

          import mx.charts.HitData;

          public function columnToolTip(hitData:HitData):String{
          var d:String = "test" + hitData.item.day;
          return d;
          }