BarChart
TheBarChart component visualizes data using rectangular bars. It supports multiple series with stacked, grouped, or 100% stacked layouts, and can be displayed vertically or horizontally.
Props
Data Props
Query result or array of objects containing the data to visualize
Column name for the x-axis (categories)
Column name for the y-axis (values)
Column name to group data into multiple series
Column name for secondary y-axis values
Bar Style Props
Bar layout type: ‘stacked’ | ‘grouped’ | ‘stacked100’
Fill color for bars (hex, rgb, or theme color name)
Opacity of bar fill (0-1)
Color for bar outlines
Width of bar outlines in pixels
Layout Props
Swap axes to create horizontal bars
Force showing all x-axis labels (may overlap)
Formatting Props
Format string for x-axis values
Format string for y-axis values
Format string for secondary y-axis values
Chart Layout Props
Chart title displayed at the top
Chart subtitle displayed below the title
Whether to show the legend
Height of the chart area in pixels
Axis Props
Title for x-axis. Use
true to use column nameTitle for y-axis. Use
true to use column nameTitle for secondary y-axis
Show vertical gridlines
Show horizontal gridlines
Show gridlines for secondary y-axis
Show labels on x-axis
Show labels on y-axis
Show labels on secondary y-axis
Show x-axis baseline
Show y-axis baseline
Show secondary y-axis baseline
Show tick marks on x-axis
Show tick marks on y-axis
Show tick marks on secondary y-axis
Axis Scale Props
Type of x-axis: ‘category’ | ‘time’ | ‘value’
Use logarithmic scale for y-axis
Base for logarithmic y-axis
Minimum value for y-axis
Maximum value for y-axis
Auto-scale y-axis to data range
Minimum value for secondary y-axis
Maximum value for secondary y-axis
Auto-scale secondary y-axis
Label Props
Show data labels on bars
Font size for labels
Position of labels: ‘inside’ | ‘outside’ | ‘top’
Color for labels
Format string for labels
Format string for y-axis labels
Format string for secondary y-axis labels
Show total label on top of stacked bars
Show labels for each series in stacked bars
Show labels for all bars
Series Props
Color palette name or array of colors
Object mapping series names to colors
Array specifying the order of series
Chart type for y2 series
Format string for series labels
Behavior Props
Sort data by x-axis values
Connect charts for synchronized interactions
Advanced Props
Custom ECharts configuration object
Custom series configuration
Print ECharts config to console
Renderer type: ‘canvas’ | ‘svg’
Enable data download
Enable image download
Empty data behavior: ‘pass’ | ‘warn’ | ‘error’
Custom empty data message
Color for y-axis
Color for secondary y-axis
Left padding for chart area
Right padding for chart area
Wrap x-axis labels