I couldn't get the role colors to work in the pie chart, so I tried a
different approach and replaced the entire Google color array with one of
my own.
<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() {
usrClr =
['#2309B2','#3416D8','#1F193F','#0A0562','#150E88','#181CF0','#091EBC','#213BB3','#4888F1','#003EA5','#002B72','#0070EE','#002855','#001C3B','#3066A1','#21466E','#097BBC','#3293CC','#1BABFF','#41B6E6','#1C7599','#338EB3','#05516C','#68D2DF','#368892','#50A2AC','#09A1B2','#5CBAC5','#90F3FF','#3BF8FD'];
var data = google.visualization.arrayToDataTable([
['Task', 'Hours per Day'],
['Work', 11],
['Eat', 2],
['Commute', 2],
['Watch TV', 2],
['Sleep', 7]
]);
var options = {
title: 'Cumplimiento Hasta Mes Actual',
is3D:true,
colors: usrClr
};
var chart = new
google.visualization.PieChart(document.getElementById('piechart_3d'));
chart.draw(data, options);
}
</script>
</head>
<body>
<div id="piechart_3d" style="width: 900px; height: 500px;"></div>
</body>
</html>
Like the usual Google colors, once all the colors are used, they restart
from the beginning again. I used an array of 30 colors, but you can use how
many you want.
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-visualization-api/07b46b54-34ab-41e5-966a-4609551432f8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.