0
組件代碼如下,代碼如下。我使用[data] = "item.data"
[name] = "item.name"
將數據綁定試圖在Kendo-ui-angular2中構建一個餅圖。顯示餅圖但不顯示標籤
private series: any[] = [{
name: ["India","Aus", "Fin"],
data: [3.907, 7.943, 7.848]
}];
<kendo-chart>
<kendo-chart-title text="Gross domestic product growth /GDP annual %/">
</kendo-chart-title>
<kendo-chart-legend position="top" orientation="horizontal">
</kendo-chart-legend>
<kendo-chart-tooltip format="{0}%">
</kendo-chart-tooltip>
<kendo-chart-series>
<kendo-chart-series-item *ngFor="let item of series" type="donut" [data]="item.data" [name]="item.name">
</kendo-chart-series-item>
</kendo-chart-series>
</kendo-chart>
我試過這樣做。但是這些值顯示爲標籤,但不是實際的標籤。 – indra257
它顯示什麼,它應該顯示什麼? – mast3rd3mon
它顯示3.907,7.943,7.848作爲標籤。我試圖將標籤顯示爲「印度」,「Aus」,「Fin」。你可以看到我如何綁定上述代碼中的數據。 – indra257