Recently, I encountered an issue with styling SVG graphics dynamically generated from data. The SVG graphic appears like this: https://i.sstatic.net/xvIpE.png
To address the problem, I turned to Canvg in hopes of converting the SVG into an image or PDF using a hidden canvas element. However, the Canvas output ends up looking like this: https://i.sstatic.net/EFuIc.png
Despite my efforts to tweak the styling using CSS, some paths seem to be missing, and the overall appearance is not quite right. Modifying properties like background color and font-family did work successfully, but others such as fill and font color didn't have any effect:
canvas#canvas {
background-color: aliceblue; //works
font-family: sans-serif; //works
font-size: 10px; //works
fill: gray; //doesn't work
}
If anyone has experience with customizing paths and font color when creating a canvas element with Canvg, I would greatly appreciate your insights!