I want to highlight the selected Y-axis label in Gantt charts. Also is there any way through which we can give some background color to the y-axis title?
yAxis: { className: "highcharts-color-0", uniqueNames: true, title: { text: "Data" }, labels: { events: { click: function () { alert("hellowww"); var chart = this, series = chart.series, plotLeft = chart.plotLeft, plotTop = chart.plotTop, plotWidth = chart.plotWidth; if (chart.myBackground) { chart.myBackground.destroy(); }
chart.myBackground = chart.renderer
.rect(10, plotTop, 500, 30, 1)
.attr({
"stroke-width": 2,
stroke: "red",
fill: "yellow",
opacity: 0.5,
zIndex: -1
})
.add();
}
}
}
}
link to code pen https://codepen.io/mehrotrarohit07/pen/PoKxvQp?editors=1010