anu_1555
Posts: 47
Joined: Sun Nov 28, 2021 8:45 am

export trellis bar charts

How can we add export functionality( image/pdf) for the trellis bar charts.below is the fiddle link .Kindly help,Thanks!

https://jsfiddle.net/we0qLgm2/3/
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: export trellis bar charts

Hi anu_1555!
Thanks for contacting us with your question!

All you need to add is an Export Module to your project. You can see, that charts now have three stripes to show the export context menu.

Demo: https://jsfiddle.net/BlackLabel/jzLoy5re/
API Reference: https://www.highcharts.com/docs/export- ... e-overview

Let me know if you have any further questions.
Regards!
Hubert Kozik
Highcharts Developer
anu_1555
Posts: 47
Joined: Sun Nov 28, 2021 8:45 am

Re: export trellis bar charts

okay thanks but with this approach I am able to export only one column at once but what I am looking for is to have only one export button at the top right corner and then export all the columns in to one chart as we are rendering. Is this possible? Thanks

https://jsfiddle.net/BlackLabel/jzLoy5re/
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: export trellis bar charts

anu_1555,
Thank you for your clarification. So in your case, I suggest you change the logic a little bit and create one chart with multiple series instead of multiple charts. Then, position them correctly by using multiple yAxes and you can use the exporting module with default options. Please, check the simple demo below - it can need some customization by you, but it shows the main idea.

Demo: https://jsfiddle.net/BlackLabel/8n4p3mve/

Let me know if that fits your requirement.
Regards!
Hubert Kozik
Highcharts Developer
anu_1555
Posts: 47
Joined: Sun Nov 28, 2021 8:45 am

Re: export trellis bar charts

Thanks. solution makes sense But am not able to find export button as was seeing before. how can i enable export buttons at the top right corner and export them?

https://jsfiddle.net/BlackLabel/8n4p3mve/
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: export trellis bar charts

anu_1555,
I set chart width to a static value, that's probably why you don't see the export button because it goes out of your screen. I have added logic to make it responsive using chart.events.render and calculating the widths of yAxes, so now you will be able to see exporting button always.

Demo: https://jsfiddle.net/BlackLabel/1v7ew43L/
API Reference: https://api.highcharts.com/highcharts/c ... nts.render

Regards!
Hubert Kozik
Highcharts Developer

Return to “Highcharts Usage”