Skip to main content

Combo Chart

Rocket 2.0

The Combo Chart component draws bars and lines on one chart, with an optional second axis on the right. Use it to compare two kinds of numbers over time, such as revenue as bars and margin percentage as a line.

Properties​

Property
Description
Expected Value
DataThe rows to plot, as a list of objects such as { month, revenue, margin }.Array
X fieldThe field in each row used for the horizontal axis, such as month.Text. Default: month
Bar series (fields)Fields drawn as bars, separated by commas.Text. Default: revenue
Line series (fields)Fields drawn as lines, separated by commas. A field already listed in Bar series (fields) is drawn as a bar only.Text. Default: margin
Right axis series (fields)Fields measured on a second axis on the right, separated by commas. Use it for values on a different scale, such as percentages.Text. Default: margin
Stack barsStacks the bars of each row on top of each other instead of side by side.On or off. Default: Off
Line curveShape of the lines between points: monotone is smooth, linear uses straight segments and step uses steps.monotone, linear, step. Default: monotone
Line dotsShows a dot at each point on the lines.On or off. Default: On
Line width (px)Thickness of the lines, in pixels.Number. Default: 2
Value formatHow values on the left axis and in tooltips are shown: as plain numbers, currency, percentages or short forms like 4.5K.number, currency, percent, compact. Default: number
Right axis formatHow values on the right axis are shown: as plain numbers, currency, percentages or short forms.number, currency, percent, compact. Default: percent
Currency codeThe currency code used when a format is currency, such as USD or EUR.Text. Default: USD
LocaleThe locale used to format numbers and currency, such as pt-BR. Leave empty to follow the currency.Text
Value prefixText shown before values on the left axis and in tooltips.Text
Value suffixText shown after values on the left axis and in tooltips.Text
Empty messageMessage shown when there is no data to plot.Text. Default: No data
AnimateAnimates the bars and lines when the chart draws.On or off. Default: On
GridShows horizontal grid lines.On or off. Default: On
LegendShows a legend with the name and color of each series.On or off. Default: On
Series labels ({ field: label })Names to show for each field in the legend and tooltips, such as { revenue: "Revenue" }.Object. Default: {"revenue": "Revenue", "margin": "Margin"}
Series colors (in order)Colors for the series, in the order they are drawn: bars first, then lines.Array
Highlight clicked pointEmphasizes the clicked bar or point until another is clicked or Clear clicked point runs.On or off. Default: Off
Loading lookWhat the chart shows while it is loading: a Spinner or a Skeleton placeholder.Spinner, Skeleton. Default: Spinner

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 clickTriggers when the user clicks a bar or point on the chart.
On double clickTriggers when the user double-clicks the chart.

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 data point and removes its highlight.components.combochart1.clearClickedPoint()
Set visibilityShows the component when true, hides it when false.components.combochart1.setVisibility(false)
Set disableDisables the component when true, enables it when false.components.combochart1.setDisable(false)
Set loadingTurns the loading state on with true, off with false.components.combochart1.setLoading(false)

Exposed Variables​

Variable
Description
How To Access
dataThe rows to plot, as a list of objects such as { month, revenue, margin }.{{components.combochart1.data}}
xFieldThe field in each row used for the horizontal axis, such as month.{{components.combochart1.xField}}
barFieldsFields drawn as bars, separated by commas.{{components.combochart1.barFields}}
lineFieldsFields drawn as lines, separated by commas. A field already listed in Bar series (fields) is drawn as a bar only.{{components.combochart1.lineFields}}
rightAxisFieldsFields measured on a second axis on the right, separated by commas. Use it for values on a different scale, such as percentages.{{components.combochart1.rightAxisFields}}
stackBarsStacks the bars of each row on top of each other instead of side by side.{{components.combochart1.stackBars}}
curveShape of the lines between points: monotone is smooth, linear uses straight segments and step uses steps.{{components.combochart1.curve}}
showDotsShows a dot at each point on the lines.{{components.combochart1.showDots}}
strokeWidthThickness of the lines, in pixels.{{components.combochart1.strokeWidth}}
yAxisFormatHow values on the left axis and in tooltips are shown: as plain numbers, currency, percentages or short forms like 4.5K.{{components.combochart1.yAxisFormat}}
rightAxisFormatHow values on the right axis are shown: as plain numbers, currency, percentages or short forms.{{components.combochart1.rightAxisFormat}}
currencyThe currency code used when a format is currency, such as USD or EUR.{{components.combochart1.currency}}
localeThe locale used to format numbers and currency, such as pt-BR. Leave empty to follow the currency.{{components.combochart1.locale}}
valuePrefixText shown before values on the left axis and in tooltips.{{components.combochart1.valuePrefix}}
valueSuffixText shown after values on the left axis and in tooltips.{{components.combochart1.valueSuffix}}
emptyTextMessage shown when there is no data to plot.{{components.combochart1.emptyText}}
animateAnimates the bars and lines when the chart draws.{{components.combochart1.animate}}
showGridShows horizontal grid lines.{{components.combochart1.showGrid}}
showLegendShows a legend with the name and color of each series.{{components.combochart1.showLegend}}
seriesLabelsNames to show for each field in the legend and tooltips, such as { revenue: "Revenue" }.{{components.combochart1.seriesLabels}}
colorsColors for the series, in the order they are drawn: bars first, then lines.{{components.combochart1.colors}}
highlightClickedEmphasizes the clicked bar or point until another is clicked or Clear clicked point runs.{{components.combochart1.highlightClicked}}
loadingIndicatorWhat the chart shows while it is loading: a Spinner or a Skeleton placeholder.{{components.combochart1.loadingIndicator}}
clickedDataPointThe data row the user last clicked.{{components.combochart1.clickedDataPoint}}
isVisibleWhether the component is visible.{{components.combochart1.isVisible}}
isLoadingWhether the component is in its loading state.{{components.combochart1.isLoading}}
isDisabledWhether the component is disabled.{{components.combochart1.isDisabled}}

Styles​

Style
Default
Chart color (series palette from it)Theme: Brand primary
Grid line colorTheme: Default border
Axis label colorTheme: Placeholder text
Legend text colorTheme: Placeholder text
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.