Overview
Bar charts represent categorical data with rectangular bars where the length of each bar is proportional to the value it represents. They’re one of the most common chart types for comparing values across categories. TeeChart supports vertical bars (columns) and horizontal bars with extensive styling options. Use cases:- Comparing values across categories
- Showing rankings or top items
- Displaying frequency distributions
- Side-by-side or stacked comparisons
Series Class
TBarSeries - The primary class for creating bar chartsKey Properties
| Property | Type | Description |
|---|---|---|
MultiBar | TMultiBar | Bar arrangement: mbNone, mbSide, mbStacked, mbStacked100, mbSideAll, mbSelfStack |
BarStyle | TBarStyle | Visual style: bsRectangle, bsPyramid, bsCilinder, bsEllipse, bsArrow, bsCone, etc. |
BarWidthPercent | Integer | Width of bars as percentage (0-100) |
OffsetPercent | Integer | Offset between bar groups |
Gradient | TChartGradient | Configure gradient fills |
BarPen | TChartPen | Customize bar outlines |
Marks | TSeriesMarks | Configure value labels |
UseOrigin | Boolean | Start bars from a custom origin |
Origin | Double | Custom origin value |
Code Examples
Basic Bar Chart
Multi-Bar Configurations
From VCL/TeeNew/SeriesType_Bar.pas:42:Bar Styles
From VCL/TeeNew/SeriesType_Bar.pas:72:Bar Chart with Gradient
From VCL/TeeNew/Bar_Gradient.pas:33:3D Bars with Custom Depth
From VCL/TeeNew/Bar_3DDepth.pas (example pattern):Rounded Bars
From VCL/TeeNew/Bar_Rounded.pas (example pattern):Customization Options
Bar Width and Spacing
Custom Colors per Bar
Horizontal Bars
Bar Marks on Top
Image Fill for Bars
From VCL/TeeNew/Bar_Image.pas (example pattern):Advanced Features
Negative Value Stacking
Bar Shadows
Click Detection
Related Chart Types
- Horizontal Bar Charts - Bars oriented horizontally
- Area Charts - Filled areas instead of bars
- Point Charts - Individual data points
- Gantt Charts - Time-based horizontal bars
