BarChartA bar chart or bar graph is a chart that presents Grouped data with rectangular bars with lengths proportional to the values that they represent.
export class BarChartDemo {
data: any;
constructor() {
this.data = {
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
datasets: [
{
label: 'My First dataset',
backgroundColor: '#42A5F5',
borderColor: '#1E88E5',
data: [65, 59, 80, 81, 56, 55, 40]
},
{
label: 'My Second dataset',
backgroundColor: '#9CCC65',
borderColor: '#7CB342',
data: [28, 48, 40, 19, 86, 27, 90]
}
]
}
}
}
barchartdemo.html
<p-chart type="bar" [data]="data"></p-chart>