Highcharts: Handling ng-click on tooltips

后端 未结 1 1784
悲&欢浪女
悲&欢浪女 2020-12-20 08:26

I need some help with a problem I am encountering. I created a chart and a custom tooltip, whenever the user clicks on the tooltip, it should call the $scope function.

1条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-20 09:16

    Compile the tooltip element after the tooltip appears.

    In the pointFormatter return string:

    pointFormatter: function() {              
      return "

    Click here

    " }

    In the click callback:

    events: {
      click: function(e) {
        tooltip.refresh(e.point, e);
        $compile(tooltip.label.div)(scope)
      }
    

    example: http://jsfiddle.net/mj9mj1n5/

    0 讨论(0)
提交回复
热议问题