Skip to main content
POST
/
v1
/
workbooks
/
{id}
/
chart
JavaScript
import Grid from '@grid-is/api';

const client = new Grid({
  apiKey: 'My API Key',
});

const response = await client.workbooks.renderChart('id', { chart: {} });

console.log(response);

const content = await response.blob();
console.log(content);
This response does not have an example.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

Body

application/json

Options for rendering a chart from workbook data.

chart
object
required

Options for rendering a chart from workbook data. Specify the data range, chart type, image output format, and title and axis labels.

apply
DataTransformation · object[] | null

Cells to update before rendering the chart. Changes are discarded at the end of the request

Examples:
[{ "target": "A2", "value": 1234 }]
width
integer | null

Width of the chart image in pixels. If not given, a width of 764px is used. A chart's height cannot be set explicitly because it will differ depending upon chart type, title, legend, axis labels, and so on.

matte
string | null
default:""

Hex color code for the chart's background matte, e.g. '#FFFFFF' for white, if not specified, the chart will have a transparent background. Note, this is currently only supported for PNG images.

Examples:

"#FFFFFF"

"#FFF"

"#fff"

Response

Chart rendered as an image

The response is of type file.

I