docs/sources/visualizations/panels-visualizations/visualizations/xy-chart/index.md
XY charts provide a way to visualize arbitrary x and y values in a graph so that you can easily show the relationship between two variables. XY charts are typically used to create scatter plots. You can also use them to create bubble charts where field values determine the size of each bubble:
{{< figure src="/media/docs/grafana/panels-visualizations/screenshot-xy-charts-v11.6.png" max-width="750px" alt="An xy chart showing height weight distribution" >}}
You can use any type of tabular data with at least two numeric fields in an xy chart. The x field can be a time field. This type of visualization doesn't require time data, but it can be used.
{{< docs/shared lookup="visualizations/config-options-intro.md" source="grafana" version="<GRAFANA_VERSION>" >}}
{{< docs/shared lookup="visualizations/panel-options.md" source="grafana" version="<GRAFANA_VERSION>" >}}
The following options let you control how data is displayed in an xy chart:
<!-- prettier-ignore-start -->| Option | Description |
|---|---|
| Series mapping | Set how series data is mapped in the chart. Choose from: Auto and Manual. Depending on your series mapping selection, the Frame, X-field, and Y-field options differ. For information on setting these specific fields, refer to the Series mapping section. |
| Size field | Set which field's values control the size of the points in the chart. This value is relative to the min and max of all the values in the data frame. When you select this option, you can then set the Min point size and Max point size options. Required in Manual mode. |
| Color field | Set which field's values control the color of the points in the chart. To use the color value options under the Standard options, you must set this field. Typically, this field is used when you only have one series displayed in the chart. Required in Manual mode. Only supports number fields. |
| Show | Set how values are represented in the visualization. Choose from: Points, Lines, or Both. |
| Point size | Set the size of all points in the chart, from one to one hundred pixels in diameter. The default size is five pixels. You can set an override to set the pixel size by series (y-field). |
| Min/Max point size | Use these options to control the minimum or maximum point size when you've set the Size field option. You can override these options for specific series. |
| Point shape | Set the shape of the points in the chart. Choose from:<ul><li>Circle - The default setting</li><li>Square </li></ul> |
| Point stroke width | The width of the point stroke in pixels. The default is one pixel. |
| Fill opacity | The opacity of the point fill. The default is 50. |
| Line style | Set the style of the lines that connect points. Choose from: Solid, Dash, or Dots. |
| Line width | The width of the lines that connect points, in pixels. |
Set how series data is mapped in the chart. Choose from:
Depending on your series mapping selection, the Frame, X-field, and Y-field options differ. These options are described in the tabs that follow:
{{< tabs >}} {{< tab-content name="Auto series mapping options" >}}
When you select Auto as your series mapping mode, the following options are preconfigured, but you can also define them yourself:
<!-- prettier-ignore-start -->| Option | Description |
|---|---|
| Frame | By default, an xy chart displays all data frames. You can filter to select only one frame. |
| X field | Select which field or fields x represents. By default, this is the first number or time field in each data frame. For an example of this in Auto mode, refer to the X field section. |
| Y field | After the x-field is set, by default, all the remaining number fields in the data frame are designated as the y-fields. You can use this option to explicitly choose which fields to use for y. For more information on how to use this in Auto mode, refer to the Y field section. |
{{< /tab-content >}} {{< tab-content name="Manual series mapping options" >}}
When you select Manual as your series mode, you can add, edit, and delete series. To manage a series, click the Series field; to rename the series, click the series name.
In Manual mode, these fields are required:
<!-- prettier-ignore-start -->| Option | Description |
|---|---|
| Frame | Select your data frame or dataset. You can add as many frames as you want. |
| X field | Select which field x represents. |
| Y field | Select which field y represents. |
{{< /tab-content >}} {{< /tabs >}}
In Auto series mapping mode, select which field or fields x represents. By default, this is the first number or time field in each data frame. For example, you enter the following CSV content:
| a | b | c |
|---|---|---|
| 0 | 0 | 0 |
| 1 | 1 | 9 |
| 2 | 2 | 4 |
In the resulting chart, the x-field is generated from the values in column "a" unless you define it differently.
In Auto series mapping mode, after the x-field is set, by default, all the remaining number fields in the data frame are designated as the y-fields. You can use this option to explicitly choose which fields to use for y.
The series of the chart are generated from the y-fields. To make changes to a series in an xy chart, make overrides to the y-field.
{{< admonition type=note >}} Any field you use in the Size field or Color field doesn't generate a series. {{< /admonition >}}
You can also use overrides to exclude y-fields individually. To do so, add an override with the following properties for each y-field you want removed:
Set how values are represented in the visualization. Choose from:
Set the style of the lines that connect points. To change the color, use the standard Color scheme field option.
{{< figure src="/media/docs/grafana/panels-visualizations/screenshot-line-style-options-v11.6.png" max-width="400px" alt="Line style options" >}}
10, 10.0, 10 (the first number represents dot length, which is always zero).Tooltip options control the information overlay that appears when you hover over data points in the visualization.
<!-- prettier-ignore-start -->| Option | Description |
|---|---|
| Tooltip mode | When you hover your cursor over the visualization, Grafana can display tooltips. Choose how they behave:<ul><li>Single - The hover tooltip shows only a single series, the one that you are hovering over on the visualization.</li><li>Hidden - Do not display the tooltip when you interact with the visualization.</li></ul> |
| Max width | Set the maximum width of the tooltip box. |
The All, Values sort order, Hover proximity, and Max height tooltip options aren't available for XY charts.
{{< docs/shared lookup="visualizations/legend-options-1.md" source="grafana" version="<GRAFANA_VERSION>" >}}
{{< docs/shared lookup="visualizations/axis-options-2.md" source="grafana" version="<GRAFANA_VERSION>" >}}
Standard options in the panel editor pane let you change how field data is displayed in your visualizations. When you set a standard option, the change is applied to all fields or series. For more granular control over the display of fields, refer to Configure field overrides.
You can customize the following standard options:
{{< docs/shared lookup="visualizations/datalink-options-2.md" source="grafana" version="<GRAFANA_VERSION>" >}}
{{< docs/shared lookup="visualizations/value-mappings-options.md" source="grafana" version="<GRAFANA_VERSION>" >}}
{{< docs/shared lookup="visualizations/thresholds-options-2.md" source="grafana" version="<GRAFANA_VERSION>" >}}
{{< docs/shared lookup="visualizations/overrides-options.md" source="grafana" version="<GRAFANA_VERSION>" >}}