Я создаю приложение, в котором мне нужны верхние графики баров, и я использовал несколько цветов для баров на графике.Но для легенды я хочу указать один конкретный цвет, и по щелчку легенды он показывает изменение на серый цвет, который является поведением по умолчанию для высокого графика
Я добавил несколько цветов в серию, поэтому я не могу добавить тот жецвет там
this.chartConfigWeekly = {
chart: {
zoomType: 'none'
},
title: {
text: 'Weekly Utilization'
},
credits: {
enabled: false
},
colors: this.colorArrWeekly,
legend: {
symbolRadius:0
},
xAxis: [
{
categories: this.weeklyUtilizationCategories,
crosshair: true,
gridLineWidth: 1,
tickmarkPlacement: 'on',
// tickInterval: 4
tickPositions: this.tickPosition,
}
],
yAxis: [
{
// Primary yAxis
labels: {
format: '{value} %',
style: {
color: 'gray'
}
},
max: 100,
min: 0,
alignTicks: false,
tickAmount: 6,
tickInterval: 20,
title: {
text: 'Utilization',
style: {
color: 'black'
}
},
opposite: true
},
{
// Secondary yAxis
// gridLineWidth: 0,
allowDecimals: false,
title: {
text: 'Number of Samples',
style: {
color: 'black'
}
},
tickAmount: 6,
labels: {
format: '{value} ',
style: {
color: 'gray'
}
}
}
],
tooltip: {
shared: true,
useHTML: true,
headerFormat: '<small>{point.point.display}</small><table><br>',
crosshairs: true,
positioner: function(labelWidth, labelHeight, point) {
var x;
if (point.plotX - labelWidth / 2 > 0) {
x = point.plotX - labelWidth / 2;
} else {
x = 0
}
return {
x: x,
y: point.plotY
}
},
shape: 'square'
},
series: [
{
name: 'total number of samples injected',
type: 'column',
yAxis: 1,
data: this.weeklyUtilizationData,
tooltip: {
valueSuffix: ''
},
colorByPoint: true
},
{
name: '% of usage per total hours 24/7',
type: 'spline',
data: this.weeklyUtilizationUsage,
tooltip: {
valueSuffix: ''
},
color: 'blue'
}
]
};