Appearance
Chart concepts
A chart is a feature that specifies how to process and render the SQL run result of a data source. Settings are split between basic settings and advanced settings on the chart edit screen.
- Basic settings: processing the data for rendering, such as dimensions, metrics, and the source filter.
- Advanced settings: adjusting the appearance, such as axes, legend, value format, and frame display.
Rendering flow
Charts are rendered in the following flow.
- Fetches the run result of the SQL specified as the data source.
- Prepares data for rendering based on the dimensions, metrics, source filter, and other basic settings.
- If all of the following conditions are met, performs equivalent processing in the browser without issuing new SQL (in-memory processing):
- The data source's run result has 1000 rows or fewer.
- Custom SQL isn't specified.
- Disable in-memory processing is off.
- Renders the chart based on the processed result (up to 1000 rows) and advanced settings.
If the data to render exceeds 1000 rows, the screen shows "Rendered with up to 1000 rows of data." See Filter, sort, and limit for the row limit.
Data modeling
A chart structures and processes the SQL run result using the following components.
| Component | SQL equivalent | Role |
|---|---|---|
| Dimension | GROUP BY clause | The axis used to split data. |
| Metric | Aggregate functions such as SUM() | The numeric value being aggregated. |
| Source filter | WHERE clause | Narrows down the data to aggregate. |
For example, to show "total sales by category" as a bar chart, you'd specify category as the dimension and sales as the metric (aggregation method SUM).
The number and role of these components that you can specify varies by chart type.
- Dimension: XY Chart's X value, Radial Chart's Label, Map Chart's latitude/longitude, and so on.
- Metric: XY Chart's Y value, Radial Chart's Value, Big Number's Metric, and so on.
- Source filter: for example, a condition to render only a specific category.
See Dimensions and metrics for details on dimensions and metrics.
In-memory processing
For chart data processing, if the data source's SQL run result has 1000 rows or fewer and Custom SQL isn't specified, equivalent processing is done in the user's browser instead of running new SQL.
This processing is called "in-memory processing," and can be disabled with Disable in-memory processing in a chart's basic settings. If you use Custom SQL, in-memory processing isn't available, and the toggle isn't shown.
See Pivot Table for an example of how results differ depending on whether in-memory processing was used.