score:1
Accepted answer
Try to use this approach:
yAxis: {
labels: {
events: {
click: function() {
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();
}
}
}
},
I hope that everything is clear from the code - in case of any doubts feel free to ask.
Demo: https://jsfiddle.net/BlackLabel/qyj327Lx/
API: https://api.highcharts.com/class-reference/Highcharts.SVGRenderer#rect
Source: stackoverflow.com
Related Query
- How to set the background of clicked or selected label on y axis gantt chart Highcharts?
- How to change the label color of Y-Axis on click in angular Gantt chart High Chart
- How to select or highlight the x axis border on click of Y axis label in gantt chart highchart
- How to give background color to selected x-axis label in highcarts gantt
- How to use click event on Y-axis label in angular Gantt chart High Chart
- How to provide styles on X axis gantt high chart
- How to change the background color the chart area in high charts?
- How to make legend labels to bring out the series of a pie chart and not make them disappear when label is clicked in HighCharts?
- How can I open a high chart in a modal window when the chart is clicked on?
- How to change the X and Y axis names of Pie chart High Chart?
- How to hide the Axis line in stack bar chart high chart
- How to set the width within axis label in highcharts
- How to set the x axis dynamically in High Charts 2.3.5
- how to set the interval of points on Y - Axis highcharts
- In high chart how to add event for label click
- Highcharts: how to set legend label name after chart created?
- Highcharts Bar Chart - How to set the minimum bar width/length
- How to set dataLabel Format and axis label angle in R highcharter package
- How do I reduce the space between title and chart of a High Chart?
- How to set default range selected on chart draw in Highcharts/Highstock
- Highcharts (Highstock) how to manually set the navigator selected range
- How to set the x value for High Charts error bar
- How do I set the background color of a Highcharts HTML label?
- How to use add series and update methods in the high chart wrapper for angular?
- Highcharts Bubble Chart - How to move an individual point's data label (dataLabel) to the front/top
- How to set variable in high chart data field
- How to set series-label to false by default and change the color of series label text in highchart
- How do I make the label in polar chart not get split automatically?
- How can I set the alignment for individual axis labels in highcharts?
- How to change the background color of measure tool in stock chart in highstock?
More Query from same tag
- Why mistake appears during render?
- Django Chartit graph not displaying. Jquery issue?
- programmatically click on column in Highcharts
- HighCharts:set the value of yAxis
- DateFormat in Tooltip for Scatter Plot does not change
- Vue2-Highcharts setOptions Lang
- Extend line until new value occurs
- Is there any way to know whether a highchart DOM is complete rendered?
- Is there a way to color boxplots based on group in hcboxplot()?
- Highcharts : yAxis, values rounded to a maximum of two decimal places
- ASP NET MVC Highcharts null pointer when adding series
- How do I remove a numerical data plot on a bar that I added in a line chart?
- Negative Fill color in AreaSpline Graph
- Tile layout for highcharts legend items
- Display Image on xAxis in highchart
- Highlight multiple series in Highcharts
- how to use hcmap highchart R shiny
- How to change style of selected point in highcharts?
- MultiAxis HighChart: show different color
- My Highchart graphs are really slow when I choose 30 day graphs
- Bar graph background
- Highchart - How do I change the colour of the baseline of the chart?
- Error when using Highcharts with Angular 2
- Highchart not displaying with svelte
- Load JSON to Highchart Series
- How to hide the context menu on clicking outside uisng JS?
- How do I create a pie chart from VML shapes?
- highcharts waterfall not summing correctly
- How to trigger a legend click in HighCharts with jQuery?
- highcharts: disable only a single element in legend so it cannot be clicked