The Bar Chart component for Retool Apps
A content area to display bar charts.
The Bar Chart component renders data in vertical bars. Bar Chart is useful for visualizing categorical data.
Refer to the charts guide for more information on building charts.
Settings
Bar Chart includes the following configurable options when building apps in the IDE.
Properties
All properties for Bar Chart with supported data types or values. You can write JavaScript almost anywhere in Retool to manipulate or read property values.
barGroupGap
The gap between bars in a group relative to the size of the bars. This can be a number between 0 and 1.
global
Whether the object is globally scoped for use in all app pages.
Whether the component is visible.
id
The unique identifier.
isHiddenOnDesktop
Whether the component is visible in the desktop layout.
isHiddenOnMobile
Whether the component is visible in the mobile layout.
legendPosition
The position of the legend.
Values
linkColorArray
The link color scale for the chart, input as an array of colors.
linkColorArrayDropDown
The link color scale for the chart, manually selected.
linkColorInputMode
The input mode for the link color scale.
Values
linkGradientColorArray
The link color scale for the chart.
maintainSpaceWhenHidden
Whether the component takes up space on the canvas if hidden
is true
.
pluginType
The plugin type.
selectedPoints
A list of selected points.
showInEditor
Whether to remain visible in the editor if hidden
is true
.
showSecondYAxis
Whether to show the second Y-axis.
The position of the stack data labels on a stacked bar chart.
Values
title
The text to display as a title.
Methods
JavaScript API methods for interacting with Bar Chart. You can write JavaScript almost anywhere in Retool and use methods to manipulate data and property values.
scrollIntoView
Scrolls the canvas or parent container so that the selected component appears in the visible area.
barChart.scrollIntoView(scrollIntoViewOptions)
Parameters
setHidden
Set the hidden
value to toggle whether the component is visible. Defaults to true
without a parameter.
barChart.setHidden(hidden)
Parameters
Events
Events are triggered by user interactions, such as clicking a button or entering a value. Use event handlers to trigger queries or other actions in response to events.
clear
The value is cleared.
hover
A chart is hovered over.
legendClick
A chart legend is clicked.
legendDoubleClick
A chart legend is double clicked.
select
A value is selected.
unhover
A chart is no longer hovered over.