sulemanrai
Posts: 13
Joined: Mon Jan 23, 2023 6:23 am

Highcharts gradient not showing when exporting graph to pdf

Screenshot 2023-06-05 at 7.15.48 PM.png
Screenshot 2023-06-05 at 7.15.48 PM.png (41.36 KiB) Viewed 224 times
I am trying to use the export module to export graph to pdf. I have a gradient in my graph but the issue is the gradient isn't showing on the pdf which is being generated. reference here regarding chart options i am using.

https://codesandbox.io/s/highcharts-rea ... =/demo.jsx

the generated pdf comes out like attached above.

when exporting to png, svg or jpeg the gradient comes out fine as shown below.

how can i generate the correct pdf
Attachments
asdasdasdasds (1).jpeg
asdasdasdasds (1).jpeg (35.06 KiB) Viewed 224 times
kamil.k
Posts: 458
Joined: Thu Oct 06, 2022 12:49 pm

Re: Highcharts gradient not showing when exporting graph to pdf

Hello sulemanrai!

Thanks for contacting us again.

It seems that the color's opacity defined in gradient doesn't get respected while exporting to PDF. In your case, only one color is defined but with different opacities, so there's no gradient effect visible. What you can do is simply define two different colors in any available format (HEX, RGB, RGBA) but with full opacity/transparency. I've changed the colors based on your example to achieve almost the same effect, take a look: https://codesandbox.io/s/highcharts-rea ... ked-ysgkc3.

As in our API: https://api.highcharts.com/class-refere ... olorString, the concepts like opacity may not be supported by the browser, so I wouldn't classify it as a bug but if you're of a different opinion, feel free to report it on our official GitHub repository: https://github.com/highcharts/highchart ... new/choose.

Let me know if you have any further questions,
Kind Regards!
Kamil Kubik
Highcharts Developer

Return to “Highcharts Usage”