如何为 Telerik Kendo UI 饼图楔形着色?
我正在使用 Telerik Kendo 饼图,并且我希望能够为楔形部分着色。
以下是我的 Kendo UI 饼图的标记:
<script type="text/javascript">
function createChart() {
jQuery("#chart").kendoChart({
theme: jQuery(document).data("kendoSkin") || "Metro",
legend: {
position: "bottom"
},
seriesDefaults: {
labels: {
visible: true,
format: "{0}%"
}
},
series: [{
type: "pie",
data: [{
category: "Remaining Work",
value: 75,
explode: true
}, {
category: "CIOs",
value: 2
}, {
category: "Other Executives",
value: 10
}, {
category: "Directors and Physicians",
value: 13
}]
}],
tooltip: {
visible: true,
format: "{0}%"
}
});
}
jQuery(document).ready(function () {
setTimeout(function () {
createChart();
// Initialize the chart with a delay to make sure
// the initial animation is visible
}, 400);
jQuery(document).bind("kendo:skinChange", function (e) {
createChart();
});
});
</script>
我希望剩余的工作为浅灰色。我该如何实现这个目标?
任何建议将不胜感激。
I'm using the Telerik Kendo Pie Chart and I want to be able to color the wedges.
The following is the mark up for my Kendo UI pie chart:
<script type="text/javascript">
function createChart() {
jQuery("#chart").kendoChart({
theme: jQuery(document).data("kendoSkin") || "Metro",
legend: {
position: "bottom"
},
seriesDefaults: {
labels: {
visible: true,
format: "{0}%"
}
},
series: [{
type: "pie",
data: [{
category: "Remaining Work",
value: 75,
explode: true
}, {
category: "CIOs",
value: 2
}, {
category: "Other Executives",
value: 10
}, {
category: "Directors and Physicians",
value: 13
}]
}],
tooltip: {
visible: true,
format: "{0}%"
}
});
}
jQuery(document).ready(function () {
setTimeout(function () {
createChart();
// Initialize the chart with a delay to make sure
// the initial animation is visible
}, 400);
jQuery(document).bind("kendo:skinChange", function (e) {
createChart();
});
});
</script>
I'd like the remaining work to be light gray. How do I accomplish this?
Any suggestions would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 Kendo UI DataViz 中,所有图表都支持通过
seriesColors
选项。该属性将采用十六进制颜色字符串数组。例如:In Kendo UI DataViz, all charts support overriding the theme colours via the
seriesColors
option. This property will take an array of hexadecimal colour strings. For example: