gpt4 book ai didi

kendo-ui - kendo ui 图表 - 将 html 和多个值添加到 series.Labels.Template

转载 作者:行者123 更新时间:2023-12-03 06:31:11 24 4
gpt4 key购买 nike

对于这个例子:

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 添加到模板中(例如 Value is: ....)?

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。

关于kendo-ui - kendo ui 图表 - 将 html 和多个值添加到 series.Labels.Template,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26618238/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com