Export Options

The KendoReact Sankey diagram allows you to export its contents as an Image, SVG, or PDF file.

Regardless of the required export format, you can use the exportVisual method to export the visuals of the Sankey component. The component exports the visuals as an Image, SVG, or PDF by using the Drawing library and saves them using the File Saver component's saveAs method.

Export to Image

Export the Sankey visual as an Image by using the exportImage method and save it using the saveAs method.

Example
View Source
Change Theme:

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 chart is based on vector graphics.

Example
View Source
Change Theme:

Export to SVG

Export the Sankey visual as an SVG by using the exportSVG method and save it using the saveAs method.

Example
View Source
Change Theme:

Export to PDF

Export the Sankey visual as a PDF by using the exportPDF method and save it using the saveAs method.

Example
View Source
Change Theme:

Fitting to Paper Size

If the rendered Sankey Chart 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 Chart to the paper size of the PDF file.

Example
View Source
Change Theme:

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—Set the SankeyOptions.
Example
View Source
Change Theme: