Highcharts calculates the height of the legend based on the elements of the legend inside it. if it overflows the height of the chart, it can cause a problem.
in the legend, you can limit the height using maxHeight, but if the label height is exceeded, maxHeight controls will appear. so itβs better to calculate the required height yourself and give it maxHeight to avoid the navigation controls,
maxHeight: (no. of legend Items or series count) * line height of each item/2
hope this might work.
source share