SvgExport
Type module
Sources
Items from SvgExport can be imported/included and used via following ways.
/** * Import via: SvgExport.ts * Access items like: $svgexport.myVariable */import * as $svgexport from "@amcharts/amcharts5/SvgExport";Variables
imageOpURLsType
WeakMapDefaultnew WeakMap()
Functions
imageOpURL(g:SceneGraphics,
canvas:HTMLCanvasElement)Returns
stringrenderToSVG(target:Root|Sprite|IDisplayObject,
options:ISvgExportOptions)Returns
stringSince 5.21.0A chart as an SVG document, whichever renderer draws it. Leaves out what image export leaves out: elements with
exportable: falseand pictures from other domains without CORS. Fully transparent elements, such as hit areas and a hidden logo, are left out too.It is the chart as last drawn: changes made in the same tick appear once the chart has drawn them (e.g. call it from the Root's
frameendedevent).Drawing the chart first may fire hover events for the pointer's position.
Pass an element, such as a series, to export just that element, where it sits on the chart.
const svg = am5.renderToSVG(root); const pixels = am5.renderToSVG(pixelSeries.pixels);var svg = am5.renderToSVG(root); var pixels = am5.renderToSVG(pixelSeries.pixels);More info: Exporting to SVGrmation