The Stacked Bar Chart component for Retool Apps
A content area to display stacked bar charts.
The Stacked Bar Chart component renders data in vertical bars, with stacked segments representing different groups or subcategories. Stacked Bar Chart is useful for visualizing categorical data and comparing data across multiple groups.
For more information about using the Stacked Bar Chart component, refer to the charts guide.
Properties
All properties for this object with supported data types or values. You can write JavaScript almost anywhere in Retool to manipulate or read property values.
barGap
The gap between bars relative to the size of the bars. This can be a number between 0 and 1.
Type | number | ||||
Format | Float | ||||
Mutability |
| ||||
Default |
|
Examples
barGroupGap
The gap between bars in a group relative to the size of the bars. This can be any number between 0
and 1
.
Type | number | ||||
Format | Float | ||||
Mutability |
| ||||
Default |
|
Examples
barMode
The list of bar modes.
Type | string | |||||||||||||||
Format | Plain Text | |||||||||||||||
Mutability |
| |||||||||||||||
Allowed Values |
| |||||||||||||||
Default |
|
Examples
barOrientation
The orientation of the bars.
Type | string | |||||||||
Format | Plain Text | |||||||||
Mutability |
| |||||||||
Allowed Values |
| |||||||||
Default |
|
Examples
chartType
The type of chart to display.
Type | string | ||||||||||||||||||||||||||||||||||||||||||
Format | Plain Text | ||||||||||||||||||||||||||||||||||||||||||
Mutability |
| ||||||||||||||||||||||||||||||||||||||||||
Allowed Values |
|
Examples
clearOnEmptyData
Whether to clear the chart when the data is empty.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
hidden
Whether this object is hidden from view.
Type | boolean | ||||||
Format | True/False | ||||||
Mutability |
| ||||||
Default |
|
Examples
id
The unique identifier (name).
Type | string | ||||
Format | Plain Text | ||||
Mutability |
| ||||
Default |
|
Examples
isHiddenOnDesktop
Whether to show or hide this object in the desktop layout.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
isHiddenOnMobile
Whether to show or hide this object in the mobile layout.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
labelData
A list of labels for each node.
Type | array | ||||
Array values | string | ||||
Mutability |
| ||||
Default |
|
Examples
legendPosition
The position of the legend.
Type | string | ||||||||||||||||||
Mutability |
| ||||||||||||||||||
Allowed Values |
|
maintainSpaceWhenHidden
Whether to take up space on the canvas if hidden
is true
.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
margin
The amount of margin to render outside.
Type | string | |||||||||
Format | Plain Text | |||||||||
Mutability |
| |||||||||
Allowed Values |
| |||||||||
Default |
|
Examples
rangeSlider
Whether to display a range slider.
Type | boolean | ||||
Mutability |
|
showInEditor
Whether the component remains visible in the editor if hidden
is true
.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
stackedBarTotalsDataLabelPosition
The position of the stack data labels on a stacked bar chart.
Type | string | ||||||||
Mutability |
| ||||||||
Allowed Values |
|
style
Custom style options.
Type | object | ||||
Mutability |
|
toolbar
The toolbar configuration.
Type | object | ||||
Mutability |
|
Object Properties
Object Properties
Object Properties
Methods
JavaScript API methods for this object. You can write JavaScript almost anywhere in Retool and use methods to manipulate data and property values.
stackedBarChart.scrollIntoView()
Scrolls the canvas or parent container so that the selected component appears in the visible area.
stackedBarChart.scrollIntoView(options)
Parameters
Examples
stackedBarChart.setHidden()
Set the hidden
value to toggle whether the component is visible. Defaults to true
without a parameter.
stackedBarChart.setHidden(hidden)
Parameters
Examples
Events
Events triggered by user interactions. You can configure event handlers in the IDE to trigger queries or other actions in response to events.
Event | Description |
---|---|
Clear | A value is cleared. |
Hover | An item is hovered over. |
Legend Click | A legend item is clicked or pressed. |
Legend Double Click | A legend item is double-clicked or pressed. |
Select | A value is selected. |
Unhover | An item is no longer hovered over. |