Studio Report Tile
The definition for a supported tile on a Data Studio report.
Example
{
"id": "MTE4e2",
"title": "Median visit duration",
"sql": "SELECT avg(duration) AS avg_duration, week_start FROM custom.web_visits;",
"chart_type": "line",
"chart_config": {
"xAxis": "week_start",
"yAxes": ["avg_duration"]
}
}
Properties
| Key | Type | Description |
|---|---|---|
id |
string | The tile’s encoded ID. |
title |
string | The display title of the tile. |
sql |
string | The SQL powering the tile. |
chart_type |
string | The type of chart to display. See chart types. |
chart_config |
object | Dynamic chart configuration based on chart type. |
Chart types
chart_type can be one of:
| Value | Description |
|---|---|
line |
Line chart. |
pie |
Pie chart. |
stacked_bar |
Stacked bar chart. |
scatter |
Scatter chart. |
table |
Table. |
Chart config
chart_config depends on chart_type:
| Chart type | Required keys | Example |
|---|---|---|
line |
xAxis, yAxes |
{"xAxis": "column_1", "yAxes": ["column_2"]} |
pie |
labelColumn, valueColumn |
{"labelColumn": "column_1", "valueColumn": "column_2"} |
stacked_bar |
xAxis, yAxes |
{"xAxis": "column_1", "yAxes": ["column_2"], "xAxisLabel": "Column 1 label", "yAxisLabel": "Column 2 label"} |
scatter |
xAxis, yAxes |
{"xAxis": "column_1", "yAxes": ["column_2"]} |
table |
None | {} |
Request body shape
When sending tiles in studio.reports.create or studio.reports.update, omit id.
| Key | Type | Description |
|---|---|---|
title |
string | The display title of the tile. |
sql |
string | The SQL powering the tile. |
chart_type |
string | The type of chart to display. See chart types. |
chart_config |
object | Dynamic chart configuration based on chart type. |