Skip to main content

element_to_svg

Function element_to_svg 

Source
pub fn element_to_svg(element: &ChartElement, width: f64, height: f64) -> String
Expand description

Convert a ChartElement tree to an SVG string.

The root element should be a ChartElement::Svg. If it’s a Div (e.g. metric cards), the output wraps it in an SVG with a <foreignObject>.