toPNG
exports data of a component to a PNG file
promise toPNG(string|object id, [string|object options] );
string|object | the exported view or its id, or the id of any HTML element | | options |
string|object | optional, a set of configuration options or the name of the output PNG file |
| promise | a "promise" object. The promise is resolved with the contents of a PNG file that is ready for downloading. |
Example
webix.toPNG($$("myChart"),{/* config options */});
Related samples
Details
options for the method can include the following:
- setting the output filename (the default name is Data.png):
webix.toPNG($$("table"), "somefile");
// or
webix.toPNG($$("table"), {
filename:"somefile"
});
- disabling the download of a file via the download property:
webix.toPNG($$("table"), {
download:false
}).then(function(blob){
//process raw data
});
- ignoring some DataTable columns in the output file:
webix.toCSV($$("table"), {
ignore: { "votes":true, "rating":true }
});
See also
Back to top
Join Our Forum
We've retired comments here. Visit our forum for faster technical support,
connect with other developers, and share your feedback there.