Skip to main content

Scatter

Ant Design

The Scatter component is Ant Design's scatter chart. It plots rows as points by two numbers, to show how they relate, such as deal size against days to close.

Properties​

Property
Description
Expected Value
DataRows to chart, one per point, such as [{ x: 12, y: 34 }].Array
X fieldField in each row that holds the number on the horizontal axis.Text. Default: x
Y fieldField that holds the number on the vertical axis. With a list of fields, only the first is plotted.Array. Default: ["y"]
Color fieldField that names each point's group. Each group gets its own color.Text
TitleHeading shown above the chart.Text
LegendWhere the legend sits, or none to hide it. The legend shows only when the chart has more than one series.top, bottom, right, none. Default: top
LabelShows each data point's value on the chart.On or off. Default: Off
Y formatterHow values on the value axis, labels and tooltips are written. auto keeps whole numbers whole and others to two decimals, percent reads 0.25 as 25%, and compact shortens large numbers to 12K or 1.2M.auto, number, currency, percent, compact. Default: compact
CurrencyCurrency code, such as USD or EUR, used when Y formatter is currency.Text. Default: USD
LocaleLocale for number formatting, such as pt-BR. Leave it empty to follow the currency's usual format.Text
Highlight clicked pointKeeps the point the user clicked highlighted and fades the others until Clear clicked point runs.On or off. Default: Off
Size fieldNumber field that sets each point's size, which turns the chart into a bubble chart.Text

Additional Actions​

Each of these can be switched on or off, or set with a logical expression by clicking fx.

Property
Description
Expected Value
VisibilityShows or hides the component. Hidden components keep their space unless Collapse when hidden is on.On or off. Default: On
Collapse when hiddenRemoves the hidden component's space, so the components below it move up.On or off. Default: Off
Loading stateShows the component's loading look and blocks interaction, for example while a query runs.On or off. Default: Off
DisableStops the user from interacting with the component.On or off. Default: Off

Devices​

Property
Description
Expected Value
Show on desktopShows the component in the desktop layout.On or off. Default: On
Show on mobileShows the component in the mobile layout.On or off. Default: Off

Events​

Add a handler from the Events section of the properties panel. See Event Triggers for the steps.

Event
Description
On element clickTriggers when the user clicks a point.

Component Specific Actions (CSA)​

Run these from an event handler with Control Component, or from a RunJS query. See Component Specific Actions.

Action
Description
How To Access
Clear clicked pointClears the clicked point, which empties selectedDatum and removes the highlight.components.scatter1.clearClickedPoint()
Set visibilityShows the component when true, hides it when false.components.scatter1.setVisibility(false)
Set disableDisables the component when true, enables it when false.components.scatter1.setDisable(false)
Set loadingTurns the loading state on with true, off with false.components.scatter1.setLoading(false)

Exposed Variables​

Variable
Description
How To Access
dataRows to chart, one per point, such as [{ x: 12, y: 34 }].{{components.scatter1.data}}
xFieldField in each row that holds the number on the horizontal axis.{{components.scatter1.xField}}
yFieldField that holds the number on the vertical axis. With a list of fields, only the first is plotted.{{components.scatter1.yField}}
colorFieldField that names each point's group. Each group gets its own color.{{components.scatter1.colorField}}
titleHeading shown above the chart.{{components.scatter1.title}}
legendWhere the legend sits, or none to hide it. The legend shows only when the chart has more than one series.{{components.scatter1.legend}}
labelShows each data point's value on the chart.{{components.scatter1.label}}
yFormatterHow values on the value axis, labels and tooltips are written. auto keeps whole numbers whole and others to two decimals, percent reads 0.25 as 25%, and compact shortens large numbers to 12K or 1.2M.{{components.scatter1.yFormatter}}
currencyCurrency code, such as USD or EUR, used when Y formatter is currency.{{components.scatter1.currency}}
localeLocale for number formatting, such as pt-BR. Leave it empty to follow the currency's usual format.{{components.scatter1.locale}}
highlightClickedKeeps the point the user clicked highlighted and fades the others until Clear clicked point runs.{{components.scatter1.highlightClicked}}
sizeFieldNumber field that sets each point's size, which turns the chart into a bubble chart.{{components.scatter1.sizeField}}
selectedDatumThe data row of the point the user clicked last, or {} after Clear clicked point.{{components.scatter1.selectedDatum}}
isVisibleWhether the component is visible.{{components.scatter1.isVisible}}
isLoadingWhether the component is in its loading state.{{components.scatter1.isLoading}}
isDisabledWhether the component is disabled.{{components.scatter1.isDisabled}}

Styles​

Style
Default
Primary colorTheme: Brand primary
Text colorTheme: Primary text
Container backgroundTheme: Surface 1
Border colorTheme: Default border
Border radius—
Box shadow0px 0px 0px 0px #00000040

A default that starts with Theme: follows the app's theme until the style is set to another value. See App Themes.