You can export Webix components to the PNG format. The components do not require any special configuration to be exported.
Export is available both in Standard and Pro versions
To export a component into a PNG file, you need to call the toPNG method. The method takes the following parameters:
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 a parameter:
webix.ui({
view:"chart",
id: "myChart",
// chart configuration
});
webix.toPNG($$("myChart"));
The dependencies which are used for providing export possibilities are taken from the Webix CDN online catalog. If you need to implement data export offline, you should complete the following steps:
1. Download the package with CDN-files from https://github.com/webix-hub/cdn-extras.
2. Rename the folder to "extras" and move it to the desired directory.
3. Set the path to the local CDN repository as in:
webix.env.cdn = "/local_folder";
Note that specifying the path to the local CDN repository has some peculiarities:
webix.env.cdn = "../../../../local_folder";
webix.env.cdn = "http://localhost/local_folder";
There are some common export customization settings that are also applicable to the toPNG method. There are also some specific settings described below.
webix.toPNG($$("table"), "somefile");
// or
webix.toPNG($$("table"), {
filename:"somefile"
});
Back to top