Как сделать так, чтобы каждая полоса на гистограмме имела другой цвет, используя angular-chartjs в ветви chartjs 2.0?
Мой холст выглядит так:
<canvas class="chart chart-bar"
chart-data="GBCC.setData"
chart-labels="GBCC.labels"
chart-options="GBCC.options"
chart-colors="GBCC.colors"
height="68"
width="300">
</canvas>
Мой контроллер GBCC выглядит так:
this.labels = ['hello', 'world', 'foobar'];
this.setData = [[50, 20, 95]];
this.colors = [
'#DCDCDC', // light grey
'#F7464A', // red
'#46BFBD', // green
];
this.options = {
scales: {
yAxes: [{
display: true,
ticks: {
beginAtZero: true,
min: 0,
max: 100,
stepSize: 20
}
}]
}
};
Он изменит все полосы на первый цвет в массиве, но не будет использовать другие цвета. Кто-нибудь знает как это сделать?