score:1
Accepted answer
you can correct data-labels positions by using the attr
method on their svg elements.
for example:
chart: {
events: {
render: function() {
const series = this.series;
const dl1 = series[3].points[0].datalabel;
const dl2 = series[4].points[0].datalabel;
if (dl1.y + dl1.height > dl2.y) {
dl2.attr({
y: dl1.y + dl1.height
});
}
}
}
}
live demo: https://jsfiddle.net/blacklabel/5lmh4owb/
api reference:
https://api.highcharts.com/class-reference/highcharts.svgelement.html#attr
Source: stackoverflow.com
Related Query
- How to detect when dataLabels are overlapping and adjust them programmatically
- Highcharts - How to programmatically toggle legend items and determine which items are selected
- Highcharts - How to force dataLabels to show labels when overlapping the content
- How to show values in Highcharts tooltip other than x and y when data points are too high?
- Using Highmaps mapbbuble and datalabels. Datalabels are not going out of screen when zoomed
- 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?
- Why are there disabled buttons in HighStock Range Selector? And how to enable them?
- Highcharts - how to do a responsive pie chart when the texts of the labels are long
- How can I hide non-selected series and axes when using XY zoom with highcharts?
- How to use Highchart auto calculated min and max values, unless they are above or below a predefined min and max
- Highcharts -- how to change line width programmatically and prevent resetting line width?
- How to show open, close, high and low in tooltip when the chart type is 'line' in highstocks?
- highchart- how do I hide y-axis, when y-axis is set with max and min limits
- Highcharts legends are overlapping when i change language to arabic
- How to dynamically adjust dataGrouping and set variable time intervals for HighStock data (HighCharts)
- how to use high chart when number of lines are dynamic
- Highcharts: Column and Bar Chart labels are incorrect when I drilldown
- Highcharts: Why text of dataLabels inside column bar are not getting justified and are overflowing
- Highstocks - how to detect when zoom button is pressed
- How do you change the height value when more items are added to highcharts dynamically?
- highcharts gauge multineedles datalabels are overlapping
- How can I put xAxis in highcharts starting in the horizontal line when all values are in 0?
- Highstock: how programmatically sum selected values and show the sum to user
- How to plot data in Highcharts where time and value are swapped?
- How to avoid overlapping of dataLabels in highchart pie chart?
- How to draw multiple segments overlapping and non overlapping in high-charts?
- How to adjust the height and width of background color in Highchart
- Higcharts: how to render background text over the chart, when there are plotBand with different colors?
- How to trigger legend click event on outside when using Highchart and no using JQuery
- Highcharts Boxplot - box with lower, upper quartile and median is not displaying when min and max are null of a category
More Query from same tag
- high charts - lost animation when pie chart sliced is programmatically set
- remove space on same parent categories | Grouped Categories Highcharts
- Pass data in highcharts
- Axis values from database in highchart
- Cannot read property 'type' of undefined highcharts highstock
- Highchart.getSVG convert to png
- Highcharts x axis date format issues
- Highcharts - Specific color zones for HighCharts navigator
- Change color of selected point in HighCharts dynamically
- Highcharts markers on line only where there are labels
- Increase the height of the legends in highcharts
- angular multiple same directives in single controller
- How to draw vertical lines on Highcharts graph?
- Event on middle click pie chart slice?
- Highcarts: help to create the JSON
- How to avoid hiding the only line showing?
- How to get 2 data-points with one name in series Line Graph Highcharts Reactjs
- when is a highchart completely loaded?
- Highcharts: Dynamically change single column width to highlight one sample
- Highcharts Barchart Category Word breaks
- HighChart: Show custom label on series (spline)
- Export stack of plots in highcharts
- Rails 4.1 Error Loading Chart: No adapter found highcharts
- Using datetime axes, but with changing scales
- Combining a horizontal bar graph and stock chart (with navigator) HighCharts
- highcharts how to load data via ajax
- How to show tickPositions as start and end for each bar in highcharts?
- How can I hide a series from initially being displayed in Highcharts
- a multi line graph in highcharts
- Issues Rendering Highcharts - Populating through PHP/MySQL