I attempted to display two charts simultaneously on a single page by utilizing the following code in HTTP:
<div class="chk-block-content">
<canvas height="100" width="500" baseChart [datasets]="barChartData" [labels]="barChartLabels" [options]="barChartOptions" [colors]="barChartColors" [legend]="barChartLegend" [chartType]="barChartType"></canvas>
</div>
<div class="chk-block-content">
<canvas height="100" width="500" baseChart [datasets]="barChartData2" [labels]="barChartLabels" [options]="barChartOptions" [colors]="barChartColors" [legend]="barChartLegend" [chartType]="bar"></canvas>
</div>
Despite configuring them in separate blocks, only the data from barChartData is displayed on the screen. In my component ts file, I defined them as follows:
public barChartdata2: any[]=[
{data: [10], label: 'Series A'},
{data: [10], label: 'Series B'}
]
public barChartLabels:string[] = [ 'January', 'February','March','April','May','June','July','August','September','October','November','December'];
public barChartType:string = 'bar';
public barChartLegend:boolean = false;
public barChartData:any[] = [
{data: [6500, 590, 800, 810, 560, 550, 400], label: 'Series A'},
{data: [2800, 480, 400, 190, 860, 207, 900], label: 'Series B'}
];
Why is only barChartData being shown?
Is there a method for me to view both datasets at once?