Skip to main content

Dual Axes

Ant Design

The Dual Axes chart plots two measures over the same x axis, each on its own value axis, such as revenue as bars and order count as a line.

Properties​

Property
Description
Expected Value
DataThe rows to plot, usually a query's data, one row per point on the x axis, such as [{ month, sales }].Array
X fieldName of the field in Data that holds the x axis value, such as a month or category.Text. Default: x
Y fieldThe two fields to plot, as [left, right], such as ['revenue', 'orders']. The first uses the left axis and the second the right axis.Array. Default: ["y", "y2"]
Color fieldA field that splits each series into groups, such as region, drawn as side-by-side bars or one line per group.Text
TitleHeading shown above the chart.Text
LegendWhere the legend sits, or none to hide it.top, bottom, right, none. Default: top
LabelShows each value on the chart.On or off. Default: Off
Y formatterHow values on the axis, labels and tooltips are written. compact shortens large numbers, such as 1.2K; percent reads 0.25 as 25%; auto shows whole numbers with no decimals and others with up to two.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 and currency formats, such as pt-BR. Leave it empty to follow the currency's usual format.Text
Highlight clicked pointKeeps the clicked mark at full strength and fades the rest, until another mark is clicked or Clear clicked point runs.On or off. Default: Off
GeometryHow each series is drawn, as [left, right], where each is column or line.Array. Default: ["column", "line"]
Shared axisPuts both series on one value axis and scale, so equal values line up, instead of giving the second series its own right axis.On or off. Default: Off

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 mark on the chart, such as a bar or 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 mark, which empties selectedDatum and removes the highlight.components.dualaxes1.clearClickedPoint()
Set visibilityShows the component when true, hides it when false.components.dualaxes1.setVisibility(false)
Set disableDisables the component when true, enables it when false.components.dualaxes1.setDisable(false)
Set loadingTurns the loading state on with true, off with false.components.dualaxes1.setLoading(false)

Exposed Variables​

Variable
Description
How To Access
dataThe rows to plot, usually a query's data, one row per point on the x axis, such as [{ month, sales }].{{components.dualaxes1.data}}
xFieldName of the field in Data that holds the x axis value, such as a month or category.{{components.dualaxes1.xField}}
yFieldThe two fields to plot, as [left, right], such as ['revenue', 'orders']. The first uses the left axis and the second the right axis.{{components.dualaxes1.yField}}
colorFieldA field that splits each series into groups, such as region, drawn as side-by-side bars or one line per group.{{components.dualaxes1.colorField}}
titleHeading shown above the chart.{{components.dualaxes1.title}}
legendWhere the legend sits, or none to hide it.{{components.dualaxes1.legend}}
labelShows each value on the chart.{{components.dualaxes1.label}}
yFormatterHow values on the axis, labels and tooltips are written. compact shortens large numbers, such as 1.2K; percent reads 0.25 as 25%; auto shows whole numbers with no decimals and others with up to two.{{components.dualaxes1.yFormatter}}
currencyCurrency code, such as USD or EUR, used when Y formatter is currency.{{components.dualaxes1.currency}}
localeLocale for number and currency formats, such as pt-BR. Leave it empty to follow the currency's usual format.{{components.dualaxes1.locale}}
highlightClickedKeeps the clicked mark at full strength and fades the rest, until another mark is clicked or Clear clicked point runs.{{components.dualaxes1.highlightClicked}}
geometryHow each series is drawn, as [left, right], where each is column or line.{{components.dualaxes1.geometry}}
sharedAxisPuts both series on one value axis and scale, so equal values line up, instead of giving the second series its own right axis.{{components.dualaxes1.sharedAxis}}
selectedDatumThe data row of the mark the user clicked last. It is empty after Clear clicked point.{{components.dualaxes1.selectedDatum}}
isVisibleWhether the component is visible.{{components.dualaxes1.isVisible}}
isLoadingWhether the component is in its loading state.{{components.dualaxes1.isLoading}}
isDisabledWhether the component is disabled.{{components.dualaxes1.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.