我使用ngx-chart创建了一个类似thins的拼图:
模板
<ngx-charts-pie-chart
[scheme]="colorScheme"
[labels]="true"
[legend]="false"
[labelFormatting]="setLabelFormatting"
[arcWidth]="0.16"
[doughnut]="true"
[results]="patients"
(select)="onSelect($event)">
</ngx-charts-pie-chart>组件
发送包含如下数据的数组
public patients: Array<any> = [
{
name: 'recorrente',
value : 67
}, {
name: 'novos',
value: 33
}
];但我需要发送带有html/css标签的数据来个性化标签,我尝试了返回函数,但不起作用。
发布于 2018-06-27 00:01:19
将标签模板放在标签内:
<ng-template #tooltipTemplate let-model="model">
<h6 style="color: #fff">{{model.series}} - {{model.name}}</h6>
<h6 style="color: #fff">It's around {{model.value | number:'1.1-2'}}%</h6>
</ng-template>https://stackoverflow.com/questions/48445538
复制相似问题