Components Export to PNG

You can export Webix components to the PNG format. The components don't require any special configuration to be exported.

The described functionality is available both in Standard and Pro versions, but pay attention that the IE browser is supported starting from version 10.

To export a component into a PNG file, you need to call the toPNG method. The method takes the next parameters:

  • id - (string, object) id or object of the exported view
  • name - (string) optional, name of an exported png file

For example, if you want to export a chart to a PNG file, you need to call the toPNG() method with the chart id as parameter:

webix.ui({
    view:"chart",
    id: "myChart",
    // chart configuration
    ...
});
 
webix.toPNG($$("myChart"));

Related sample:  Export to PNG

Exporting Data Offline

The dependencies which are used for providing export possibilities are generally taken from Webix CDN online catalog. If you need to implement data export offline, you should complete the following steps:

webix.cdn = "/local_folder";

Note that specifying the path to the local CDN repository has some peculiarities:

1) in case you set the path relative to the current page, it should be specified as:

webix.cdn = "../../../../local_folder";

2) the absolute path to the repository should be specified as follows:

webix.cdn = "http://localhost/local_folder";
Back to top