Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix/547-image-in-svg-fail #550

Closed
wants to merge 18 commits into from
Closed

Conversation

jszuminski
Copy link
Contributor

Fixed #547, add XLink namespace for SVG results.


Internal note

As described in #547, the SVG is not being rendered properly when there is an <image xlink:href="base64-image-url"... in the SVG.

Here's the cause:

Namespace prefix xlink for href on image is not defined

For this reason, the downloaded SVG is incorrect (and the preview in the Export Server's UI does not work as well).

  1. The Export Server returns a proper base64 representation of the SVG
  2. The inlined <svg> tag in an HTML document will work without the xmlns:xlink attribute. However, it will not work as a standalone SVG (or for image/svg+xml file).
  3. As Highcharts SVGs are always inlined in an HTML document, there is no xmlns:xlink attribute defined. This is however needed in the exporting solution.

The solution in this pull request addresses this issue by adding the proper xmlns:xlink attribute to the SVG right before downloading or previewing it. The perfect solution would most likely be to include this attribute on the Highcharts side, not here - but we can consider this later.

@jszuminski jszuminski added the bug label Jul 31, 2024
@jszuminski jszuminski self-assigned this Jul 31, 2024
Make the chart options available again in the customCode context which is compatible to the previous, phantomjs/node export server.
Fixes #548
Copy link
Contributor

@PaulDalek PaulDalek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work!

@PaulDalek PaulDalek closed this Feb 10, 2025
@PaulDalek PaulDalek deleted the bugfix/547-image-in-svg-fail branch February 10, 2025 15:31
@PaulDalek PaulDalek removed the bug label Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Chart being not rendering correctly in case of file format: image/svg+xml
5 participants