例如:
http://dojo.telerik.com/arIhI/2
$("#chart").kendoChart({
dataSource: {
data: [
{ score: 1.1, legend: 'a' },
{ score: 2.5, legend: 'b' },
{ score: 3.25, legend: 'c' }
]
},
series: [{
field: "score",
labels: {
visible: true,
template: "Score is: #: value #% legend is: ????"
},
}]
});
2个问题:
1) 是否有可能将html添加到模板中(比如值为:…)?
2) 是否可以向标签添加多个值。我想添加分数和传奇。
-谢谢。
1)确定
template: "<b>Score is:</b> #: value #% legend is: ????"
是有效的模板。
2) 这样做:
template: "Score is: #= dataItem.score #% legend is: #= dataItem.legend #"
或者使用一个我认为更方便的功能:
template: function(e) { return "Score is: " + e.dataItem.score + "% legend is: " + e.dataItem.legend }
更新:目前无法将html添加到series.labels.templates.