在ng-google-chart中添加活动

时间:2015-07-20 12:21:27

标签: angularjs charts

我正在使用API Doc,但我不知道如何添加选择事件。

http://vuta.info/dynamic-uitableviews-height-with-auto-layout-in-swift/中可以看到方法'registerWrapperListener',但我没用过它

在这个例子中添加select-event有什么想法?

谢谢你

} else if (received) {
'use strict';

angular.module('google-chart-example', ['googlechart']).controller("MainCtrl", function($scope) {

  var chart1 = {};
  chart1.type = "OrgChart";
  chart1.cssStyle = "height:200px; width:300px;";
  chart1.data = {
    cols: [{
      id: 'Name',
      label: 'Name',
      type: 'string'
    }, {
      id: 'Manager',
      label: 'Manager',
      type: 'string'
    }, {
      id: 'ToolTip',
      label: 'ToolTip',
      type: 'string'
    }],
    rows: [{
      c: [{
        v: '0',
        f: 'CEO'
      }, {
        v: ''
      }, {
        v: 'The CEO'
      }]
    }, {
      c: [{
        v: '1',
        f: 'worker 1'
      }, {
        v: '0'
      }, {
        v: ''
      }]
    }]
  };
  $scope.chart = chart1;

});

1 个答案:

答案 0 :(得分:0)

在你的HTML代码中,它将是:

<div google-chart chart="chart" style="{{chart.cssStyle}}" on-select="selectCallbackMethodYouWant(selectedItem)" />