为什么饼图和柱形图的 Higcharst 默认列不同?您可以在这里看到:http://jsfiddle.net/RqvU4/即约翰在柱形图和饼图上有不同的颜色?如何在不手动定义颜色的情况下使其相同?
最佳答案
它们的颜色不同,因为 highcharts
为每个 serie
添加了不同的颜色。
您可以看到默认颜色here .
您可以手动为每个系列设置颜色
,如下所示。
{
type: 'pie',
name: 'Total consumption',
data: [{
name: 'Jane',
color: '#4572A7',
y: 13
}, {
name: 'John',
color: '#AA4643',
y: 23
}, {
name: 'Joe',
color: '#89A54E',
y: 19
}],
center: [100, 50],
size: 100,
showInLegend: false,
dataLabels: {
enabled: false
}
}
关于javascript - Highcharts 饼图和柱形的默认颜色不一样?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12250962/