# XYZ Chart

## Render Types

XYZ charts support the following render types.

| Scatter <picture><source srcset="/files/ncrZwu0rRW4hTFRsG9rN" media="(prefers-color-scheme: dark)"><img src="/files/1BQIdefUUROjBfZPbhl0" alt="XYZ Scatter"></picture> | Bubble <picture><source srcset="/files/DKyG6aOFK5WjlWDIRyeC" media="(prefers-color-scheme: dark)"><img src="/files/8QDK5g7SMuENoAR29GEH" alt="XYZ Bubble"></picture> | Heatmap <picture><source srcset="/files/qSnp2VtAOKzCQLEQltyO" media="(prefers-color-scheme: dark)"><img src="/files/j2OgfbikZ2lrg3etmZm9" alt="XYZ Heatmap"></picture> |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

## Specifications

### Aggregation

In XYZ charts, the [X-axis and Y-axis are dimensions and the Z-axis is a metric](/data-exploration/chart/chart-common.md#dimension-metric), and Z-axis values are aggregated for each combination of X and Y. (In [XY charts](/data-exploration/chart/xy-chart.md), the X-axis is a dimension and the Y-axis is a metric, so Y-axis values are aggregated for each X.)

| Item     | Role      | Notes                               |
| -------- | --------- | ----------------------------------- |
| X-axis   | Dimension | X values become the axis            |
| Y-axis   | Dimension | Y values become the axis            |
| Z-axis   | Metric    | Used for bubble and heatmap         |
| Grouping | Dimension | Scatter/Bubble only (splits series) |

#### Example Configurations

* Show "Total sales by product category × region" as a heatmap
  * X-axis (Dimension): Product category
  * Y-axis (Dimension): Region
  * Z-axis (Metric): Total sales
* Show "Relationship between ad spend and sales" as a bubble chart
  * X-axis (Dimension): Ad spend
  * Y-axis (Dimension): Sales
  * Z-axis (Metric): Profit

### X-Axis Specifications

In XYZ charts, the handling of the X-axis and Y-axis changes depending on the render type.

* For heatmaps, both the X-axis and Y-axis are categorical axes
* For scatter and bubble charts, the X-axis is categorical/time/numeric based on the data type, and the Y-axis is a numeric axis

For axis behavior (categorical/time/numeric display rules), see [Categorical Axis, Time Axis, Numeric Axis](/data-exploration/chart/xy-chart.md#x-axis) in the XY chart page.

## Tips

### Frame Feature

XYZ charts support the frame feature. See [Frame Feature](/data-exploration/chart/chart-common.md#frame-feature) for details.

### Reference Line

Reference lines are also available in XYZ charts. See [Reference Line](/data-exploration/chart/xy-chart.md#reference-line) in the XY chart page.

### Trend

Trends are also available in XYZ charts. See [Trend](/data-exploration/chart/xy-chart.md#trend) in the XY chart page.

### Statistics

Statistics are also available in XYZ charts. See [Statistics](/data-exploration/chart/xy-chart.md#statistics) in the XY chart page.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.codatum.com/data-exploration/chart/xyz-chart.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
