The Bar Charts components helps you to simply create a beautiful bar chart for displaying the data.
The below codes are editable and you can modify them the way you want directly from your browser, please use the green button or the ctrl + s to save the changes.
Vertical Bar Chart
leaderboard
Vertical Bar Chart
Sales related to age average
1// Material Dashboard 2 React Examples2import VerticalBarChart from"examples/Charts/BarCharts/VerticalBarChart";34<VerticalBarChart5icon={{ color:"info", component:"leaderboard"}}6title="Vertical Bar Chart"7description="Sales related to age average"8chart={{9 labels:["16-20","21-25","26-30","31-36","36-42","42+"],10 datasets:[{11 label:"Sales by age",12 color:"dark",13 data:[15,20,12,60,20,15],14}],15}}16/>
Used to set the chart data. It should be an object that contains the `labels` and `datasets` keys and these keys should be an array.
The `datasets` key is an array of objects with the following keys: `label`, `color` and `data`. You can pass as many objects as you want for the datasets array.
Its a required prop.
Horizontal Bar Chart
leaderboard
Horizontal Bar Chart
Sales related to age average
1// Material Dashboard 2 React Examples2import HorizontalBarChart from"examples/Charts/BarCharts/HorizontalBarChart";34<HorizontalBarChart5icon={{ color:"info", component:"leaderboard"}}6title="Horizontal Bar Chart"7description="Sales related to age average"8chart={{9 labels:["16-20","21-25","26-30","31-36","36-42","42+"],10 datasets:[{11 label:"Sales by age",12 color:"dark",13 data:[15,20,12,60,20,15],14}],15}}16/>
Used to set the chart data. It should be an object that contains the `labels` and `datasets` keys and these keys should be an array.
The `datasets` key is an array of objects with the following keys: `label`, `color` and `data`. You can pass as many objects as you want for the datasets array.
Its a required prop.
Reports Bar Chart
Website Views
Last Campaign Performance
schedulecampaign sent 2 days ago
1// Material Dashboard 2 React Examples2import ReportsBarChart from"examples/Charts/BarCharts/ReportsBarChart";34<ReportsBarChart5color="info"6title="Website Views"7description="Last Campaign Performance"8date="campaign sent 2 days ago"9chart={{10 labels:["Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],11 datasets:{12 label:"Sales",13 data:[450,200,100,220,500,100,400,230,500]14},15}}16/>