在ng2-chart(http://www.chartjs.org/docs/latest/) - 圆环图中是否有任何选项可以在图表中每次都显示标签,而不仅仅是在工具提示中显示标签?
组件:
public mobileChartOptions: any = {
responsive: true,
legend: {
display: true,
position: 'bottom',
labels: {
padding: 10
}
}
};
public mobileOptions = Object.assign({
elements: {
arc: {
borderWidth: 0
}
}
}, this.mobileChartOptions);
public mobileUsersData: {
colors: [{
backgroundColor: ["#3FB7D0", "#6C71CC", "#ffeb3b", "#4caf50", "#2196f"]
}],
options: this.mobileOptions,
chartType: 'doughnut',
labels: [],
data: [],
loaded: false,
dataAvailable: false
};
HTML:
<canvas height=" " baseChart class="chart"
[data]="mobileUsersData.data"
[labels]="mobileUsersData.labels"
[options]="mobileOptions"
[colors]="mobileUsersData.colors"
[chartType]="mobileUsersData.chartType"
(chartHover)="chartHovered($event)">
</canvas>