Dashboard.toImage

Syntax

toImage({

    settings

});

Parameters

settings. JSON object with the Renderer parameter for image rendering.

The following parameters are available in the Renderer parameter:

Parameter name Type Brief description
Rendered function Function that handles the event occurring on screenshot rendering.
Scale number Screenshot display zoom.

Description

The toImage method creates a dashboard screenshot.

Example

To execute the example, make sure that the repository contains a dashboard with the 88665 key.

Create an HTML page with example of placing the KapBox component and execute the following operations:

  1. Open the dashboard with the 88665 key:

kapBox.open({
    Key: 88665
});
  1. Execute the following in the console:

function openImage(sender, args) {
    console.log(args.Canvas.toDataURL(), "_blank");
}
kapBox.toImage({
    Renderer: {
        Rendered: openImage,
        Scale: 2
    }
});

After executing the example the console displays image URL. To open the image, paste the copied URL to browser search bar and open the URL.

See also:

Dashboard