I am trying to change the background of the piechart from white to black but am unable to change it ,checked on the internet but its specifically showing the color change of pie chart bars
The code
function drawChart(obj,total) {
// console.log(obj.online);
if(total == 0){
var data = google.visualization.arrayToDataTable([
['Task', 'Hours per Day'],
['Users: ' +0+'',15]
]);
}
else{
if(obj.online != 0 && obj.offine != 0){
var data = google.visualization.arrayToDataTable([
['Task', 'Hours per Day'],
['Online Users: '+obj.online+'',obj.online],
['Offline Users: ' +obj.offline+'',obj.offline]
]);
}
else if(obj.online != 0 && obj.offine == 0){
var data = google.visualization.arrayToDataTable([
['Task', 'Hours per Day'],
['Online Users: '+obj.online+'',obj.online],
]);
}
else{
var data = google.visualization.arrayToDataTable([
['Task', 'Hours per Day'],
['Offline Users: ' +obj.offline+'',obj.offline]
]);
}
}
var options = {
title: 'Online Users',
sliceVisibilityThreshold:0
};
var chart = new google.visualization.PieChart(document.getElementById('piechart'));
chart.draw(data, options);
}
Where should add the bg color?
any help would be highly appreciated