I created two doughnut google charts on my website and I turned off legend. I also stylized the html of tooltip and when I click on the piece of doughnut I am able to trigger the tooltip. The thing is that I want to trigger the specific part of doughnut from my legend written in html, is it even possible? My code is similar to:
function drawChart() {
var data = new google.visualization.DataTable();
data.addColumn("string", "");
data.addColumn("number", "");
data.addRows([
["A", 1],
["B", 1],
["C", 2],
["D", 3],
["E", 4],
["F", 5],
["G", 6],
["H", 2],
["I", 1]
]);
var chart = new google.visualization.PieChart("my_chart");
chart.draw(data, chart_options);
}
var chart_options = {height: 300,
pieHole: 0.5,
chartArea: {"width": "90%", "height": "90%"},
tooltip: {
isHtml: true,
trigger: "selection"
},
legend: {
position: "none"
}};
google.charts.load("current", {"packages":["corechart"]});
google.charts.setOnLoadCallback(function() {drawChart() });
and my html code is similar to:
<table id="summary">
<tr>
<td>A:</td>
<td>1</td>
</tr>
<tr>
<td>B:</td>
<td>1</td>
</tr>
<tr>
<td>C:</td>
<td>2</td>
</tr>
</table>
How can I trigger tooltip on "A" part of google charts when clicking (hover) on table tr td which contains "A" entry ?