Bar chart
Bootstrap 5 Bar chart component
Responsive Bar chart built with Bootstrap 5. Learn how to create a Bootstrap Bar Chart and see examples of proper implementation and customization.
Basic example
You can initialize simple charts with data-mdb-attributes
- it doesn't require
any additional JS code.
Note: This method allows only one dataset - more complicated charts require JavaScript initialization.
Via data-mdb-attributes:
The same effect achieved via Javascript initialization:
Bar chart horizontal
Change the orientation of your bar chart from vertical to horizontal by setting
the indexAxis
option to 'y'
.
Bar chart with custom options
MDB provides default options for each chart - you can easily change that by passing an object with your custom options to the Chart constructor.
Note: Read API tab to learn more about available options.
Bar chart with custom tooltip
Set custom text format inside a tooltip by using plugins
option.