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
- Highcharts multiple series
- Printing from Highcharts returns focus to the top of the page
- using angular directive to draw highchart pie chart but when i am using it in success function it is not working
- Show how many elements every X time with HighCharts
- If series data array is null show message no data available
- How to change space value between grid and yAxis in Highcharts line chart
- Highcharts, mixed stacked & non-stacked columns
- Plot bar chart from top to bottom
- How to change the layout and the alignment of the legend in the Highchart?
- pie chart legend overlap with older legend when replace series in highchart
- How to remove plot gridlines using Highcharts in R
- Highcharts labels appears twice
- Highcharts - Drag to move on xAxis
- Possible to connect the zoom on two Highcharts graphs?
- highcharts Nested Grouping right side border missing
- Highchart data from ajax its not working for me
- Highcharts update xAxis category when calling series.setData
- how to set Navigator label formatter in highcharts
- How to show data point in Box Plot highcharts
- How can I convince Highcharts to display the right (mine) steps on yaxis?
- Highcharts won't render in my MVC4 .NET project
- X-Axis label mixes time with date
- Highchart Z-Index practice not functioning
- Alignment of y axis labels and text
- Use max yAxis when plotting boolean values
- Use JSON with HighCharts and AJAX
- Highchart startR is undefined under N(H, "parts/PieSeries.js", [H["parts/Globals.js"], H["parts/Utilities.js"]] highcharts.js file
- Reversing the min and max values in column chart
- Highcharts - Ignore Series in Pie Percentage
- Looping data inside highchart.js using type column chart