manigandan
Posts: 189
Joined: Fri Jan 22, 2016 7:14 am

Missing stack and data labels when export chart

Hi,

In the below jsfiddle, have used data labels and stack labels in the chart. Some of the values in data and stack labels are missing when download using export.
http://jsfiddle.net/f3raoL1n/

In the below image, have downloaded using png format:
export issue.PNG
export issue.PNG (242.76 KiB) Viewed 458 times
Have encircled the areas in which values missing.

Expected behavior: Should display all the values in data and stack labels while download using export chart.
Regards,
Manigandan
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: Missing stack and data labels when export chart

Hi manigandan,

Thanks for contacting us with your issue.

I can't find any stack labels in your shared demo but that is not relevant. Please try to add allowOverlap: true option to all data labels settings, as this should fix the problem. Let me know if that worked and if not please provide me with simplified demo, try to reduce all unnecessary options and keep only what is essential to show the issue. Thanks in advance.
API reference: https://api.highcharts.com/highcharts/p ... lowOverlap

Side note - setting allowOverlap globally for all series in plotOptions is not enough because series specific options have priority, you need to set it for each series related data labels options.

Best regards!
Mateusz Bernacik
Highcharts Developer
manigandan
Posts: 189
Joined: Fri Jan 22, 2016 7:14 am

Re: Missing stack and data labels when export chart

Hi Mateusz,
While setting allowOverlap as true, data labels get overlapped with each other and looks messy or hides some values by overlapping.
Is there any option to control the fontSize of data labels dynamically in order to avoid overlapping?

Please find the below fiddle,
https://jsfiddle.net/gL9mtqsb/2/
1.PNG
1.PNG (112.68 KiB) Viewed 422 times
Expectation: Should download with all data labels without overlapping with each other.
Regards,
Manigandan
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: Missing stack and data labels when export chart

Hi manigandan,

Unfortunately such functionality doesn't exist right now, fort size of data labels can't be changed dynamically. If you would like to see such feature then I highly encourage you to leave your feedback on Highcharts user voice (https://highcharts.uservoice.com/forums ... script-api), and to create feature request on github.

Few things that could potentially help:
- Adjust your exported chart size. In your first example some of your labels aren't exported because they don't have enough space not only vertically but also horizontally,
- Slightly reduce data labels padding. By default the padding is larger than required to not overlap labels. You can try to reduce it by few px.
- Consider reducing number of data labels. Perhaps some of them aren't that important and you could either disable them completely or show conditionally based on some criteria.

Let me know if you have any further questions.
Best regards!
Mateusz Bernacik
Highcharts Developer

Return to “Highcharts Usage”