# XYZ Chart

## Render Types

XYZ charts support the following render types.

| <p>Scatter </p><p><picture><source srcset="https://1875572357-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzP7hFWzU2Jj7xMbv2nyp%2Fuploads%2Fgit-blob-e2c23339908a367a1159882b19e65e0bb8d4122f%2Fxyz-scatter-dark.png?alt=media" media="(prefers-color-scheme: dark)"><img src="https://1875572357-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzP7hFWzU2Jj7xMbv2nyp%2Fuploads%2Fgit-blob-ac8dad71a4a958694040c804c4a1c31f3d7ad1bd%2Fxyz-scatter-light.png?alt=media" alt="XYZ Scatter"></picture></p> | <p>Bubble </p><p><picture><source srcset="https://1875572357-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzP7hFWzU2Jj7xMbv2nyp%2Fuploads%2Fgit-blob-5ce1fc371c62367c9f316c8964d6361f0801707d%2Fxyz-bubble-dark.png?alt=media" media="(prefers-color-scheme: dark)"><img src="https://1875572357-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzP7hFWzU2Jj7xMbv2nyp%2Fuploads%2Fgit-blob-1ea413fa2ba50ab01e9257d7267c427d08648d03%2Fxyz-bubble-light.png?alt=media" alt="XYZ Bubble"></picture></p> | <p>Heatmap </p><p><picture><source srcset="https://1875572357-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzP7hFWzU2Jj7xMbv2nyp%2Fuploads%2Fgit-blob-dc8ba0d6220a9c34d57f631e98a24c4251c73813%2Fxyz-heatmap-dark.png?alt=media" media="(prefers-color-scheme: dark)"><img src="https://1875572357-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzP7hFWzU2Jj7xMbv2nyp%2Fuploads%2Fgit-blob-8e9a02c4f112cbcd8a1358d7006508d95803c402%2Fxyz-heatmap-light.png?alt=media" alt="XYZ Heatmap"></picture></p> |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

## Specifications

### Aggregation

In XYZ charts, the [X-axis and Y-axis are dimensions and the Z-axis is a metric](https://docs.codatum.com/data-exploration/chart-common#dimension-metric), and Z-axis values are aggregated for each combination of X and Y. (In [XY charts](https://docs.codatum.com/data-exploration/chart/xy-chart), 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](https://docs.codatum.com/data-exploration/xy-chart#x-axis) in the XY chart page.

## Tips

### Frame Feature

XYZ charts support the frame feature. See [Frame Feature](https://docs.codatum.com/data-exploration/chart-common#frame-feature) for details.

### Reference Line

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

### Trend

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

### Statistics

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