google 图表传递段值

google chart pass segment value

我正在尝试弄清楚如何从 google 圆环图到 javascript 的段传递值。在这个 example(甜甜圈)之后,我修改了 html,如:onmouseover="segmentMouseOver(event)" 传递 onMouseOver 事件。虽然,我找不到一种方法来传递甜甜圈段的值,鼠标悬停在该段上。

欢迎任何帮助!

// Instantiate and draw our chart, passing in some options.
var chart = new google.visualization.PieChart(document.getElementById('donutchart'));    

function selectHandler() {
  var selectedItem = chart.getSelection()[0];
  if (selectedItem) {
    var topping = data.getValue(selectedItem.row, 0);
    alert('The user selected ' + topping);
  }
}

google.visualization.events.addListener(chart, 'select', selectHandler); 
chart.draw(data, options);

你可以了解更多here