Generic Javascript View: CSS style missing on SVG output


I’m fairly new to Knime and right now trying out the Generic Javascript view. So far I’ve managed to create a view with help of C3. Now I’m trying to export my view as SVG image but it seems that the CSS style is not included.

The SVG output looks like this:

while the output in the interactive view looks like this:

My code for generating the SVG image:

var serializer = new XMLSerializer();
var svgElement = document.getElementById(‘chart’).getElementsByTagName(‘svg’)[0];
var graph = serializer.serializeToString(svgElement);
return graph;

Any idea on how the get the CSS style included in the SVG image? I thought that the knimeService.inlineSvgStyles(svgElement) would do the trick, but it doesn’t seem to work? Any input appreciated.


Hey Ted,

welcome to the KNIME forum. The inlineSvgStyles should do exactly that. Could you provide your workflow or the CSS that you used, so that i can check what might be wrong?