Javascript 高位图表中的图例不应拾取系列数据中指定的颜色
我的代码如下:Javascript 高位图表中的图例不应拾取系列数据中指定的颜色,javascript,highcharts,legend,Javascript,Highcharts,Legend,我的代码如下: var options = { chart: { type: 'column', events: { click: $scope.goToPath(link) } }, title: { text: "" }, xAxis: { categories: ['You', 'Average', 'Top Quartile'], labels: { style: { fontSi
var options = {
chart: {
type: 'column',
events: {
click: $scope.goToPath(link)
}
},
title: {
text: ""
},
xAxis: {
categories: ['You', 'Average', 'Top Quartile'],
labels: {
style: {
fontSize: '14px',
color: 'grey'
}
}
},
yAxis: {
title: {
text: ''
}
},
plotOptions: {
column: {
colorByPoint: true,
dataLabels: {
enabled: true,
color: '#000000',
style: {
fontWeight: 'bold'
},
formatter: $scope.getBarValues()
}
}
},
series: [{
showInLegend: true,
name: 'Planning Sites',
data: metric1["chart_numbers"],
colors: ['#3399CC', '#CCCC33', '#686868']
}, {
showInLegend: true,
name: 'Build Out And Implementation',
data: metric2["chart_numbers"],
colors: ['#99CBE5', '#E4E599', '#BFBFBF']
}
]
}
Black color - Planning
Grey color - Build Out
在这里,我想自定义显示的图例,使其不使用在每个系列元素的颜色数组中指定的颜色。我该怎么做
我想要的图例如下:
var options = {
chart: {
type: 'column',
events: {
click: $scope.goToPath(link)
}
},
title: {
text: ""
},
xAxis: {
categories: ['You', 'Average', 'Top Quartile'],
labels: {
style: {
fontSize: '14px',
color: 'grey'
}
}
},
yAxis: {
title: {
text: ''
}
},
plotOptions: {
column: {
colorByPoint: true,
dataLabels: {
enabled: true,
color: '#000000',
style: {
fontWeight: 'bold'
},
formatter: $scope.getBarValues()
}
}
},
series: [{
showInLegend: true,
name: 'Planning Sites',
data: metric1["chart_numbers"],
colors: ['#3399CC', '#CCCC33', '#686868']
}, {
showInLegend: true,
name: 'Build Out And Implementation',
data: metric2["chart_numbers"],
colors: ['#99CBE5', '#E4E599', '#BFBFBF']
}
]
}
Black color - Planning
Grey color - Build Out
以下是JSIDLE:对于每个系列,您还可以设置
颜色,请参见:您能提供一个JSIDLE和您的示例吗?