As the title states, I'm unable to change the chart colour for this donut chart, basically I want Slightly concerned to green, very concerned to orange and extremely concerned to red.
<!DOCTYPE html>
<html>
<head>
<title>Concern Levels about Cash Reserves</title>
<script type="text/javascript">
google.charts.load("current", {packages:["corechart"]});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Answer Choices', 'Response Percent', { role: 'style' }],
['Not concerned', 21.89, '#0000FF'], // Blue using hex code
['Slightly concerned', 42.06, '#008000'], // Green using hex code
['Very concerned', 25.75, '#FFA500'], // Orange using hex code
['Extremely concerned', 10.3, '#FF0000'] // Red using hex code
]);
var options = {
title: 'Concern Levels about Cash Reserves',
pieHole: 0.4,
};
var chart = new google.visualization.PieChart(document.getElementById('donutchart'));
chart.draw(data, options);
}
</script>
</head>
<body>
<div id="donutchart" style="width: 900px; height: 500px;"></div>
</body>
</html>