Looks like it's to do with the order of the answers, but to change the 
colour - the flow of the questions doesn't make sense.



On Wednesday 15 May 2024 at 15:03:26 UTC+1 B wrote:

> Hello,
>
> 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.
>
> Wondering if anyone can tell me where I'm going wrong:
>
> <!DOCTYPE html>
> <html>
> <head>
> <title>Concern Levels about Cash Reserves</title>
> <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([
> ['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>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-visualization-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/8ee09b95-04f4-43a0-a55e-5fdd67a38f70n%40googlegroups.com.

Reply via email to