Export Options
The Kendo UI for Angular Sankey diagram provides built-in support for Image, PDF, and SVG export.
As a result, you can send a Base64-encoded file to a service or save it on the client machine by using the saveAs
method.
The Sankey diagram supports the following export options:
Export to Image
The following example demonstrates how to save the Sankey diagram as a PNG image by using the exportImage
method.
By default, the exported image is of the same size as the Sankey DOM element. If required, you can export the file to a different resolution. If you change the image size, the image quality will not be affected because the rendering of the Sankey diagram is based on vector graphics.
Exporting to SVG
The following example demonstrates how to save the Sankey diagram as an SVG file by using the exportSVG
method.
Exporting to PDF
The exportPDF
method from the Drawing library takes a visual element and produces a PDF file out of it.
Saving as PDF
The following example demonstrates how to save the Angular Sankey diagram as a PDF file by using the exportPDF
method.
Fitting to Paper Size
If the rendered Sankey diagram is bigger than the exported PDF paper size, then the chart is clipped. To avoid this behavior, either:
- Set the
exportVisual
size, or - Scale the drawing element, which is returned by the
exportVisual
method.
The following example demonstrates how to fit the exported Sankey diagram to the paper size of the PDF file.
Exporting to Drawing Visuals
The exportVisual
method returns a Drawing scene which you can further process.
The following example demonstrates how to export the Sankey diagram as a Drawing visual scene by using the exportVisual
method.
Customize the Export
You can customize the export in the exportVisual
method using the SankeyExportVisualOptions
. The following options are available:
width
—Set the width of the exported visual.height
—Set the height of the exported visual.options
—Overrides the widget configuration with the provided SankeyOptions object.