I'm working on a google visualizations pie chart and want each individual slice to link to a different page. I know there's another question already very similar to this, but I don't understand the answer. I've worked a bit with HTML and CSS but this is the first thing I've done in JavaScript and I'm definitely lost. I want my user to be able to click on a slice of the chart and then be taken to a new page. The page needs to be different for each slice of the chart if possible. Thank you! Here's my code:
<html>
<head>
<html>
<head>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
google.charts.load('current', {'packages':['corechart']});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Field', 'Number of Proposals'],
['Sustainability', 242],
['Education', 699],
['Information Technology', 240],
['Health & Wellness', 247],
['Community Development', 353],
['Public Policy', 138],
['Equity', 276],
['Food & Water', 131],
['Energy', 84],
['Security (Cyber & Other)', 56],
]);
var options = {'width': 1200,
'height': 700,
colors: ['#8C1D40', '#FFC627', '#6F6F6F', '#935669', '#FFDA74', '#919191', '#96757F', '#FEE9B0', '#BBBBBB', '#DEDEDE']
};
var chart = new google.visualization.PieChart(document.getElementById('piechart'));
chart.draw(data, options);
google.visualization.events.addListener (chart, 'select', function(){
var selection = chart.getSelection();
console.log(selection);
});
}
</script>
</head>
<body>
<div id="piechart" style="width: 900px; height: 500px;"></div>
</body>
</html>