-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Open
Labels
Description
Would you like to work on this feature?
- Check this if you would like to implement a PR, we are more than happy to help you go through the process.
What problem are you trying to solve?
The SVG generated by Chartist does not work outside of browsers. Image viewers cannot handle foreignObject and the erroneous xmlns property used inside. Also, because CSS is used for a lot of the styling, an exported chart is completely transparent.
Describe the solution you'd like
A chart export function that iterates the SVG tree and generates a new SVG, using getComputedStyle to add stroke colors, widths and other styling to the chart elements.
Describe alternatives you've considered
I don't see much alternatives except rendering a PDF or similar, which is very brittle.
Documentation, Adoption, Migration Strategy
My current approach is a separate function that traverses the SVG object to create a whole new SVG. It works for my current use case, but might not be elaborate enough for all use cases.
jaredkrinke