I am using Angular 9 + Google Charts via npm: npm install angular-google-charts
I want to set different colors to all columns in column charts but it's setting first color to all columns.
Did anybody encounter such problem or have any solution for setting different colors to columns in google column chart?
HTML:
<google-chart #chart
[title]="title"
[type]="type"
[data]="data"
[columns]="columnNames"
[options]="options"
[width]="width"
[height]="height">
</google-chart>
TypeScript:
export class ColumnChartComponent[![enter image description here][1]][1] {
title = 'Population (in millions)';
type = 'ColumnChart';
data = [
["2012", 900],
["2013", 1000],
["2014", 1170],
["2015", 1250],
["2016", 1530]
];
columnNames = ['Year', 'Asia'];
// chart options in which I am setting colors
options = {
colors: ['#5cb85c', '#f0ad4e', '#d9534f', '#5bc0de', '#f6c7b6'],
};
width = 550;
height = 400;
}