highcharts / highcharts-ios

iOS wrapper for Highcharts.
Other
127 stars 39 forks source link

PDF Export in dark mode not working properly #406

Closed skuske closed 1 year ago

skuske commented 2 years ago

The PDF export does not work correctly in dark mode. First, it seems that a chart is always generated as a PDF in light mode. So: if dark mode is active before calling the exportToPDF function, then the PDF will be generated in the light mode of the chart.

However, this produces the following error: if colors from an asset catalogue were used in the diagram, which differ depending on the mode (light / dark), then the diagram is rendered in light mode during the PDF file generation, but the colors are still those of the dark mode (i.e. light axis labels, which are then no longer visible in the light diagram).

This means that the PDF export function only works properly if the diagram was already visible in light mode BEFORE the exportToPDF function was called.

Steps to reproduce this:

  1. Set up a few colors in an Asset catalog, with variants for light / dark mode.
  2. Turn on DarkMode on the target device.
  3. Create a chart in dark mode that uses some of the colors from the asset catalogue.
  4. Call exportToPDF.
  5. The PDF will show a light mode chart, but the colors from the asset catalogue have not adopted accoring to the light mode, the colors are still the ones for dark mode.

I am wondering why the exportToPDF always exports a chart in light mode, even if dark mode is on ...

ihnatmoisieiev commented 2 years ago

Hello @skuske, thank you for the reporting. We will investigate the issue and come back to you as soon as possible.

ihnatmoisieiev commented 1 year ago

Hello @skuske, we have checked and colors in the PDF are rendering according to the asset catalog.

We didn't catch:

The PDF will show a light mode chart

and

exportToPDF always exports a chart in light mode, even if dark mode is on

Could you please describe what did you mean?

Everything looks like works as expected.

skuske commented 1 year ago

Well, I stopped using the PDF export due to this issue and I am now using my own PDF export functionality. I'll close this now, since the PDF export never worked fine for me (see https://github.com/highcharts/highcharts-ios/issues/365)