我怎样才能在angular-chart.js v1.0.0和课程ChartJS v2.1.6中做到这一点
How can I set different colours for each bar in angular-chart.js?
答案 0 :(得分:2)
example
https://jsfiddle.net/3qas1ar8/3/
答案 1 :(得分:0)
public barChartColors: Array<any> = [
{
**backgroundColor: ["#36a2eb", "rgba(47, 132, 71, 0.8)", "rgba(30, 50, 71, 0.8)", "green", "blue", "purple", "orange"
],**
borderColor: 'rgba(105,159,177,1)',
pointBackgroundColor: 'rgba(105,159,177,1)',
pointBorderColor: '#fafafa',
pointHoverBackgroundColor: '#fafafa',
pointHoverBorderColor: 'rgba(105,159,177)'
},
];
这将为条形图中的每个条提供不同的颜色。