Generic Javascript View: CSS style missing on SVG output

Hi,

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];
knimeService.inlineSvgStyles(svgElement);
svgElement.querySelectorAll(‘g’).forEach(b=>b.removeAttribute(‘clip-path’));
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.

Br,
Ted

1 Like

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?

Greetings,
Daniel

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.