How can i add different colors to Bars in Column chart. Adding colors field in option is not working. Please help.
Below is the code snippet:
tdata.addRow([col1, arr[0].Manual])
tdata.addRow([col2, arr[0].Auto]);
tdata.addRow([col3, arr[0].Amount]);
options = {
fontSize: 12,
height: 430,
width: 380,
chartArea: { left: "25%", top: "20%", right: "5%", bottom: "10%" },
backgroundColor: '#f5f5f5',
title: 'Project',
pieSliceText: 'value',
colors: ['red', 'green', 'blue'],
'is3D': true
};
var chart = new google.visualization.ColumnChart(document.getElementById('drilldown_div'));
chart.draw(tdata, options);
return false;
the
colors
option applies colors to each seriesso if you have 3 colors
you would need 3 y-axis columns
as follows...
to color individual columns within a series,
use a
'style'
column roleas follows...
note: using a
'style'
column role will invalidate the legendThis is answer according to google document, use color property instead of background color.
you can find more here