Charts Can';无法在Angular2中获得google orgchart选择

Charts Can';无法在Angular2中获得google orgchart选择,charts,google-visualization,orgchart,Charts,Google Visualization,Orgchart,我的代码如下所示: drawGraph() { let theChart; let handler = () => { let sel = theChart.getChart().getSelection(); alert('selection occurred'); console.log('selection event', sel, Object.keys(sel)); }; this.google = this.getGoogle();

我的代码如下所示:

drawGraph() {
  let theChart;
  let handler = () => {
    let sel = theChart.getChart().getSelection();
    alert('selection occurred');
    console.log('selection event', sel, Object.keys(sel));
  };

  this.google = this.getGoogle();
  this.dataTable = this.getDataTable();
  this.orgData.fillDataTable(this.dataTable, 'PALA,SRINIVASRAO');
  console.log('data', this.dataTable);
  this.dataTable.setRowProperty(1, 'style', 'border: 0');
  this.chart = this.createWrapped('OrgChart', 'chartDiv', this.dataTable);
  theChart = this.chart;
  this.chart.draw();
  this.google.visualization.events.addListener(this.chart, 'select', handler);
}
图表绘制得很好,我的evert处理程序被命中,但getSelection()只返回[“0”]。顺便说一下,createWrapped正在使用google.visualization.ChartWrapper

那么我做错了什么?除了试图让它在TypeScript下工作之外,我的意思是:

getSelection()
是一个图表方法,而不是图表包装器方法

相反


this.chart.getChart().getSelection()

谢谢。我意识到了这一点,并为自己的工作感到高兴。因此,我忘了更新这里。