作者:wjb201212 | 来源:互联网 | 2022-11-05 16:03
I have gone through the documents of ng2-charts but I couldn't find anything like Stacked Bar
. Is there is any other way to achieve Stacked Bar chart in ng2-charts
? Please help me out
1> Aviad P...:
这是绝对受支持的,在文档中有chart.js
记录。您只需要使用对象stack
上的属性来定义将哪些数据集堆叠在一起datasets
:
public barChartData: ChartDataSets[] = [
{ data: [65, 59, 80, 81, 56, 55, 40], label: 'Series A', stack: 'a' },
{ data: [28, 48, 40, 19, 86, 27, 90], label: 'Series B', stack: 'a' }
];
例如,请参见此堆叠闪电战。