---
category: [Administration & Integrations, Platform and Product Extensions, Platform and Product Extensions/Integration, Administration & Integrations/Custom Integrations & Apps, Platform and Product Extensions/Workday Extend]
keyword: [Extend, Presentation Components, widgets, tags, UI components]
nav: wcp_docs
parent_url: /wcp_docs/
title: scatterChart2
layout: subsection
wd_wcptag: scatterChart2
---

<a id="section_N10021_N1001E_N10001"></a>
Displays data as a collection of points charted on an X and Y axis. Specify the `horizontalAxisPositions` and `verticalAxisPositions` datasets that define the numerical data corresponding to the X and Y axes, respectively. You can define <i>either</i> :

-   `bubbleColors` for the categorical dataset corresponding to the bubble colors, or
-   `quadrantOptions` for quadrant line positions and quadrant color options.


Use `scatterChart2` on view pages and as a view-only widget on edit pages. `scatterChart2` doesn't update when the data changes on an edit page.

## <a id="section_zfk_nwy_grb"></a>Examples

This sample `scatterChart2` displays the quota on the X axis and recruits dataset on the Y axis. The region dataset determines the bubble color, and the hired recruits determine the bubble size. The vertical axis minimum is -25, and the chart also shows a regression line. The tooltip includes all dataset values for the bubble on hover.

![](GUID-a1a32aab-034f-4686-bfbc-b6ca9dd2a6a6-enHYPHENus.png)

The sample `scatterChart2` with bubble size and color:

```
{
 "type": "scatterChart2",
 "id": "scatterChartExample1",
 "data": "<% chartData.getChartData() %>",
 "dataVariableName": "data",
 "verticalAxisPositions": {
   "name": "Finance Recruits",
   "value": "<% data.recruits.finance %>"
 },
 "horizontalAxisPositions": {
   "name": "Quota",
   "value": "<% data.quota %>"
 },
 "bubbleSizeDataSet": {
   "name": "Hired Recruits",
   "value": "<% data.hiredRecruits %>"
 },
 "bubbleColorDataSet": {
   "name": "Region",
   "value": "<% data.region %>"
 },
 "verticalAxisOptions": {
   "axisTitle": "Recruits",
   "axisMinimum": "<% -25 %>"
 },
 "horizontalAxisOptions": {
   "axisTitle": "Recruiters"
 },
 "showRegressionLine": true
}
```

This next sample `scatterChart2` uses quadrants, and displays the quota dataset on the X axis and finance recruit measurements on the Y axis. The `quadrantOptions` contains quadrant color attributes; the `horizontalOriginPosition` and `verticalOriginPosition` attributes determine the quadrant line positions. The tooltip includes the X, Y, and size values for the bubble on hover.

![](GUID-7ec5f2df-3526-4799-9bff-c0f2c805ee8f-enHYPHENus.png)

The sample `scatterChart2` with the `quadrantOptions`:

```
{
 "type": "scatterChart2",
 "id": "scatterChartExample2",
 "data": "<% chartData.getChartData() %>",
 "dataVariableName": "data",
 "verticalAxisPositions": {
   "name": "Finance Recruits",
   "value": "<% data.recruits.finance %>"
 },
 "horizontalAxisPositions": {
   "name": "Quota",
   "value": "<% data.quota %>"
 },
 "quadrantOptions": {
   "horizontalOriginPosition": "<% 110 %>",
   "verticalOriginPosition": "<% 85 %>",
   "upperRightQuadrantColor": "POSITIVE",
   "upperLeftQuadrantColor": "POSITIVE",
   "lowerLeftQuadrantColor": "NEUTRAL",
   "lowerRightQuadrantColor": "NEGATIVE"
 }
}
```

See [Reference: Sample Data for Chart 2.0 Examples](/wcp_docs/jmr1634444223025.html).

## <a id="section-mobile-support"></a>Mobile Support

Android, iOS

## <a id="section_qpw_1kc_ccb"></a>Attributes

-   <b>horizontalAxisPositions</b>

    Data type: MeasurementDataSet map

    (Required) The numerical dataset that corresponds to the X axis.

    A MeasurementDataSet map contains these attributes:

    -   <b>name</b>

        Data type: stringScript

        (Required) The name of this dataset. By default, the chart uses the names of all datasets in the axis title unless overridden in the axis options. The chart also uses this name in the legend and tooltip.

    -   <b>value</b>

        Data type: numberScript

        (Required) The measurement axis value of the dataset. References the `dataVariableName`.

    -   <b>hideInTooltip</b>

        Data type: boolean

        If true, the chart removes this data from the tooltip that displays on hover. The default is false.

    -   <b>numberFormatCode</b>

        Data type: string

        The Excel format code for formatting the numeric value. For possible number format codes, see the Microsoft Excel documentation: [Number format codes](https://support.microsoft.com/en-us/office/number-format-codes-5026bbd6-04bc-48cd-bf33-80f18b4eae68).

        The `numberFormatCode` attribute is mutually exclusive with `numberFormatOptions`.

    -   <b>numberFormatOptions</b>

        Contains options for formatting the numeric value. The `numberFormatOptions` attribute is mutually exclusive with `numberFormatCode`. Within `numberFormatOptions`, you can include any of these attributes for each measurement dataset:

        -   <b>formatType</b>

            Data type: FormatType enum

            The notation for formatting the numeric value. Valid values:

            -   NORMAL (default) - Example: 0.123
            -   SCIENTIFIC - Example: 1.23E-1
            -   PERCENT - Example: 12.3%

        -   <b>signType</b>

            Data type: SignType enum

            The sign symbol for negative values. Valid values:

            -   MINUS (default) - Example: -123
            -   PARENTHESIS - Example: (123)

        -   <b>precision</b>

            Data type: integer

            The non-negative number of decimal places to display. Default is 4.

        -   <b>showTrailingZeros</b>

            Data type: boolean

            If true, display the trailing zeros if the number of decimal places is less than the precision. Example: If the value is 1.23, `precision` is 4, and `showTrailingZeros` is true, the displayed value is 1.2300.



-   <b>verticalAxisPositions</b>

    Data type: MeasurementDataSet map

    (Required) The numerical dataset that corresponds to the Y axis.

    A MeasurementDataSet map contains these attributes:

    -   <b>name</b>

        Data type: stringScript

        (Required) The name of this dataset. By default, the chart uses the names of all datasets in the axis title unless overridden in the axis options. The chart also uses this name in the legend and tooltip.

    -   <b>value</b>

        Data type: numberScript

        (Required) The measurement axis value of the dataset. References the `dataVariableName`.

    -   <b>hideInTooltip</b>

        Data type: boolean

        If true, the chart removes this data from the tooltip that displays on hover. The default is false.

    -   <b>numberFormatCode</b>

        Data type: string

        The Excel format code for formatting the numeric value. For possible number format codes, see the Microsoft Excel documentation: [Number format codes](https://support.microsoft.com/en-us/office/number-format-codes-5026bbd6-04bc-48cd-bf33-80f18b4eae68).

        The `numberFormatCode` attribute is mutually exclusive with `numberFormatOptions`.

    -   <b>numberFormatOptions</b>

        Contains options for formatting the numeric value. The `numberFormatOptions` attribute is mutually exclusive with `numberFormatCode`. Within `numberFormatOptions`, you can include any of these attributes for each measurement dataset:

        -   <b>formatType</b>

            Data type: FormatType enum

            The notation for formatting the numeric value. Valid values:

            -   NORMAL (default) - Example: 0.123
            -   SCIENTIFIC - Example: 1.23E-1
            -   PERCENT - Example: 12.3%

        -   <b>signType</b>

            Data type: SignType enum

            The sign symbol for negative values. Valid values:

            -   MINUS (default) - Example: -123
            -   PARENTHESIS - Example: (123)

        -   <b>precision</b>

            Data type: integer

            The non-negative number of decimal places to display. Default is 4.

        -   <b>showTrailingZeros</b>

            Data type: boolean

            If true, display the trailing zeros if the number of decimal places is less than the precision. Example: If the value is 1.23, `precision` is 4, and `showTrailingZeros` is true, the displayed value is 1.2300.



-   <b>accessibilityMode</b>

    Data type: booleanScript

    If true, the chart renders with patterns for visual accessibility. The default is false.

-   <b>animateOnLoad</b>

    Data type: boolean

    If true, the chart renders with an animation on page load. The default is false.

-   <b>bubbleColorDataSet</b>

    Data type: CategoryDataSet map

    The categorical dataset used in the legend. These categories correspond to the colors of the bubbles. This attribute is mutually exclusive with `quadrantOptions`. When you specify both `bubbleColors` and `quadrantOptions`, `quadrantOptions` takes precedence.

    A CategoryDataSet map contains these attributes:

    -   <b>name</b>

        Data type: stringScript

        (Required) The name of this dataset. By default, the chart uses the names of all datasets in the axis title unless overridden in the axis options. The chart also uses this name in the legend and tooltip.

    -   <b>value</b>

        Data type: stringScript

        (Required) The category axis or legend value of the dataset. References the `dataVariableName`.

    -   <b>hideInTooltip</b>

        Data type: boolean

        If true, the chart removes this data from the tooltip that displays on hover. The default is false.


-   <b>bubbleSizeDataSet</b>

    Data type: MeasurementDataSet map

    The numerical dataset for the sizes of the bubbles. If not specified, the chart renders all bubbles with the same size.

    A MeasurementDataSet map contains these attributes:

    -   <b>name</b>

        Data type: stringScript

        (Required) The name of this dataset. By default, the chart uses the names of all datasets in the axis title unless overridden in the axis options. The chart also uses this name in the legend and tooltip.

    -   <b>value</b>

        Data type: numberScript

        (Required) The measurement axis value of the dataset. References the `dataVariableName`.

    -   <b>hideInTooltip</b>

        Data type: boolean

        If true, the chart removes this data from the tooltip that displays on hover. The default is false.

    -   <b>numberFormatCode</b>

        Data type: string

        The Excel format code for formatting the numeric value. For possible number format codes, see the Microsoft Excel documentation: [Number format codes](https://support.microsoft.com/en-us/office/number-format-codes-5026bbd6-04bc-48cd-bf33-80f18b4eae68).

        The `numberFormatCode` attribute is mutually exclusive with `numberFormatOptions`.

    -   <b>numberFormatOptions</b>

        Contains options for formatting the numeric value. The `numberFormatOptions` attribute is mutually exclusive with `numberFormatCode`. Within `numberFormatOptions`, you can include any of these attributes for each measurement dataset:

        -   <b>formatType</b>

            Data type: FormatType enum

            The notation for formatting the numeric value. Valid values:

            -   NORMAL (default) - Example: 0.123
            -   SCIENTIFIC - Example: 1.23E-1
            -   PERCENT - Example: 12.3%

        -   <b>signType</b>

            Data type: SignType enum

            The sign symbol for negative values. Valid values:

            -   MINUS (default) - Example: -123
            -   PARENTHESIS - Example: (123)

        -   <b>precision</b>

            Data type: integer

            The non-negative number of decimal places to display. Default is 4.

        -   <b>showTrailingZeros</b>

            Data type: boolean

            If true, display the trailing zeros if the number of decimal places is less than the precision. Example: If the value is 1.23, `precision` is 4, and `showTrailingZeros` is true, the displayed value is 1.2300.



-   <b>chartMarkLabel</b>

    Data type: objectScript

    A PMD script that can reference the `dataVariableName` and evaluates to a number or a string. The chart uses `chartMarkLabel` as the label next to the mark on the chart data, not on the axis. Example: Labels on the individual bar mark.

-   <b>data</b>

    Data type: listScript

    (Required) A PMD script or endpoint that returns a list of data rendered by the chart.

    This sample `data` uses a sample script <i>chartData.getChartData()</i>, which returns a list.

    ```
    "data": "<% chartData.getChartData() %>"
    ```

    To reference each object in the data list, use `dataVariableName`.

-   <b>dataVariableName</b>

    Data type: string

    (Required) The variable name that references objects in the list returned by the `data` script. Specify only alphanumeric and underscore characters.

-   <b>colors</b>

    Data type: listScript

    A list of colors that override the default color palette of the chart 2.0 widgets. Specify valid CSS color names, hex string values, or both. If you specify an incorrect color or hex value, it displays as black.

    For each data point, the chart rotates through the colors in the list and repeats them as needed. To ensure nonrepeating colors on a chart with many data points, specify at least as many colors as the legend on the chart.

    This sample `colors` attribute uses a PMD script:

    ```
    "colors": "<% customColorPalettes.getMyPalette() %>"
    ```

    This example uses color and hex values:

    ```
    "colors": "<% ['red', 'orange', 'yellow', 'green', '#FFb2AE'] %>"
    ```

-   <b>hideChartControls</b>

    Data type: boolean

    If true, the chart hides the controls that allow zooming and panning. The default is false.

-   <b>horizontalAxisOptions</b>

    Data type: MeasurementAxisOptions map

    The options for the numerical X axis.

    A MeasurementAxisOptions map contains these attributes:

    -   <b>axisIncrement</b>

        Data type: numberScript

        The increment value of this axis. If not specified, the chart determines the default value based on the measurement data.

        The `axisIncrement` value must be positive.

    -   <b>axisMinimum</b>

        Data type: numberScript

        The minimum value of this axis. If not specified, the chart determines the default value based on the measurement data.

        The `axisMinimum` value must be less than the `axisMaximum`.

    -   <b>axisMaximum</b>

        Data type: numberScript

        The maximum value of this axis. If not specified, the chart determines the default value based on the measurement data.

        The `axisMaximum` value must be greater than the `axisMinimum`.

    -   <b>axisTitle</b>

        Data type: stringScript

        The label override for the axis title. When null or empty, the default value is the concatenation of the names of the datasets along this axis.

    -   <b>comparisonLineLabel</b>

        Data type: stringScript

        The label of the comparison line that displays on hover.

    -   <b>comparisonLineValue</b>

        Data type: numberScript

        The axis position where the comparison line renders.

    -   <b>hideAxisTitle</b>

        Data type: boolean

        If true, the chart hides the axis title. The axis title is the label of the entire axis. The default is false.

    -   <b>hideAxisValues</b>

        Data type: boolean

        If true, the chart hides the value labels along the axis. The axis values are the labels at each point along the axis. The default is false.


-   <b>id</b>

    Data type: stringScript

    Unique identifier used for debugging purposes only.

    Notes:

    -   The `id` must start with a letter.
    -   The `id` must be unique per page.

-   <b>legendPosition</b>

    Data type: LegendPosition enum

    The position where to display the legend. Valid values:

    -   BOTTOM (default)
    -   TOP
    -   LEFT
    -   RIGHT
    -   HIDDEN

-   <b>quadrantOptions</b>

    Data type: QuadrantOptions map

    Defines the four quadrant positions and their associated colors. This attribute is mutually exclusive with `bubbleColors`. When you specify both `bubbleColors` and `quadrantOptions`, `quadrantOptions` takes precedence.

    A QuadrantOptions map contains these attributes:

    -   <b>horizontalOriginPosition</b>

        Data type: numberScript

        The horizontal position of the origin. The default is 0.

    -   <b>lowerLeftQuadrantColor</b>

        Data type: QuadrantColor enum

        The lower left quadrant color, which is the color of the points in this quadrant. Valid values:

        -   NEGATIVE - Red (default)
        -   POSITIVE - Green
        -   NEUTRAL - Gray

    -   <b>lowerRightQuadrantColor</b>

        Data type: QuadrantColor enum

        The lower right quadrant color, which is the color of the points in this quadrant. Valid values:

        -   NEGATIVE - Red (default)
        -   POSITIVE - Green
        -   NEUTRAL - Gray

    -   <b>upperLeftQuadrantColor</b>

        Data type: QuadrantColor enum

        The upper left quadrant color, which is the color of the points in this quadrant. Valid values:

        -   POSITIVE - Green (default)
        -   NEGATIVE - Red
        -   NEUTRAL - Gray

    -   <b>upperRightQuadrantColor</b>

        Data type: QuadrantColor enum

        The upper right quadrant color, which is the color of the points in this quadrant. Valid values:

        -   POSITIVE - Green (default)
        -   NEGATIVE - Red
        -   NEUTRAL - Gray

    -   <b>verticalOriginPosition</b>

        Data type: numberScript

        The vertical position of the origin. The default is 0.


-   <b>render</b>

    Data type: booleanScript

    If true, this tag renders as a widget on the page. If false, the page doesn't add this widget. The default is true.

-   <b>showOutline</b>

    Data type: boolean

    If true, the chart renders with outlines. The default is false.

-   <b>showRegressionLine</b>

    Data type: boolean

    If true, the chart renders a regression line. The default is false.

-   <b>sortOrder</b>

    Data type: stringScript

    When you set `sorted` to true on the `section` or `fieldSet` parent of this widget, the `sortOrder` attribute determines the order of this widget within its parent. The sort order is relative to the siblings of the widget.

    Typical values are "a", "b", "c", and so on. Example: The widget with `"sortOrder": "a"` displays before the widget with `"sortOrder": "b"`.

    <b>Note:</b> The `sortOrder` doesn't apply to sorting data on the widget. `sortOrder` only applies to the placement order of the widgets within the parent widget.

-   <b>verticalAxisOptions</b>

    Data type: MeasurementAxisOptions map

    The options for the numerical Y axis.

    A MeasurementAxisOptions map contains these attributes:

    -   <b>axisIncrement</b>

        Data type: numberScript

        The increment value of this axis. If not specified, the chart determines the default value based on the measurement data.

        The `axisIncrement` value must be positive.

    -   <b>axisMinimum</b>

        Data type: numberScript

        The minimum value of this axis. If not specified, the chart determines the default value based on the measurement data.

        The `axisMinimum` value must be less than the `axisMaximum`.

    -   <b>axisMaximum</b>

        Data type: numberScript

        The maximum value of this axis. If not specified, the chart determines the default value based on the measurement data.

        The `axisMaximum` value must be greater than the `axisMinimum`.

    -   <b>axisTitle</b>

        Data type: stringScript

        The label override for the axis title. When null or empty, the default value is the concatenation of the names of the datasets along this axis.

    -   <b>comparisonLineLabel</b>

        Data type: stringScript

        The label of the comparison line that displays on hover.

    -   <b>comparisonLineValue</b>

        Data type: numberScript

        The axis position where the comparison line renders.

    -   <b>hideAxisTitle</b>

        Data type: boolean

        If true, the chart hides the axis title. The axis title is the label of the entire axis. The default is false.

    -   <b>hideAxisValues</b>

        Data type: boolean

        If true, the chart hides the value labels along the axis. The axis values are the labels at each point along the axis. The default is false.




