How to select or highlight the X-Axis in the Gantt chart on click of the Y-axis label?
yAxis: {
className: "highcharts-color-0",
uniqueNames: true,
title: {
text: "Data"
},
labels: {
events: {
click: function () {
alert("hellowww");
const chart = this.chart;
const axis = this.axis;
const labelPos = this.pos;
const tick = axis.ticks[labelPos];
const x = chart.marginRight;
const width = tick.slotWidth;
const height = axis.height / axis.tickPositions.length;
const y = axis.top + labelPos * height;
chart.renderer
.rect(x, y, tick.slotWidth, height)
.attr({
fill: "yellow",
zIndex: 0
})
.add();
}
}
}
}
The above code is working fine with the selection of the Y-Axis Label but I also want to highlight the selected row in X-Axis. Is there any way to achieve the same?
code pen URL https://codepen.io/mehrotrarohit07/pen/PoKxvQp?editors=1010