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 Articles
- How to set the background of clicked or selected label on y axis gantt chart Highcharts?
- How to give background color to selected x-axis label in highcarts gantt
- JasperReports: HTML5 high chart X Axis label font size
- High Charts Column Chart - Y axis Label Formatting
- How to use click event on Y-axis label in angular Gantt chart High Chart
- x axis label word wrap in high charts for radar chart
- How to provide styles on X axis gantt high chart
- 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
- Is there a way to config high chart Y Axis label to appear larger?
- Formatting axis label in high chart using dynamic values
- In high chart how to add event for label click
- Laravel 5.5 Console TV Bar Chart High Charts multipleDatasets and label
- Too long chart axis label title
- High Chart Data label Formatter not working properly
- tickinterval not working high chart for x axis
- Highcharts display label for pie chart using html table as data source
- Highcharts - Bar chart show full label on Y Axis
- Highcharts drilldown to pie chart - Clicking on axis label with multiple series causes pie charts to overlap
- high chart label outside of view
- On Mouse over on the high chart data the tool tip value should be displayed next to legend label
- How to auto adjust Y axis plot lines in live high chart
- High Chart set x axis value in hours format
- highcharts y axis label with offset is hidden when chart has no title
- High Chart X Axis to display month and year
- How to draw a background behind a plotLine label in a highstock chart
- React / High chart / Stacked bar label for each block
- Highchart Gantt remove Y Axis label
- Angular 7 High Charts Stock Chart Datetime X Axis tooltip formatting independently of other tooltips
- How to change the background color the chart area in high charts?
- Highstock Column Chart dragging issue
- Drawing a dynamic Mixed Bar and Line chart with HIghchart.js with socket.io for live data
- JSON Result for Highcharts Data Object in C#
- Updating spline chart two lines on top of eachother
- Xaxis should get aligned at (0,0) in highcharts
- Wrong x-axis position and formatting when only 1 data series sent to chart
- Highstock: animate chart update when scrollbar is dragged or navigator handle is released
- How to create highcharts dynamically on click buttons
- How to make scrollable plot area fill all chart's background area in highcharts?
- Highcharts- this.category returns undefined
- Changing the way the data is shown in Highcharts
- How do i set the X-Axis as Date Array in highcharts.js simple highcharts.chart plot or .stockChart?
- Highcharts won't draw line when series values are all 0
- D3.js tooltips not displaying correctlty when generated with Highcharts
- highchart network network-graph
- Boost Enable/Disabled with update Method in Highcharts
- How to show relation between two boxes containing same data in two different treemaps
- Highcharts: Rotate VU dials
- How to convert array values of console into highcharts
- Don't display not present date values