Javascript 如何给Telerik Kendo UI饼图按钮上色?
我正在使用Telerik剑道饼图,我希望能够给楔子上色 以下是我的剑道UI饼图的标记:Javascript 如何给Telerik Kendo UI饼图按钮上色?,javascript,jquery,jquery-plugins,telerik,kendo-ui,Javascript,Jquery,Jquery Plugins,Telerik,Kendo Ui,我正在使用Telerik剑道饼图,我希望能够给楔子上色 以下是我的剑道UI饼图的标记: <script type="text/javascript"> function createChart() { jQuery("#chart").kendoChart({ theme: jQuery(document).data("kendoSkin") || "Metro", legend: { position: "bottom
<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>
函数createChart(){
jQuery(“图表”)。肯多卡特({
主题:jQuery(document.data(“kendoSkin”)| |“Metro”,
图例:{
位置:“底部”
},
系列默认值:{
标签:{
可见:对,
格式:{0}%
}
},
系列:[{
键入:“馅饼”,
数据:[{
类别:“剩余工作”,
价值:75,
爆炸:真的
}, {
类别:“首席信息官”,
价值:2
}, {
类别:“其他高管”,
数值:10
}, {
类别:“主任和医生”,
价值:13
}]
}],
工具提示:{
可见:对,
格式:{0}%
}
});
}
jQuery(文档).ready(函数(){
setTimeout(函数(){
createChart();
//延迟初始化图表以确保
//初始动画可见
}, 400);
jQuery(document).bind(“剑道:皮肤变化”,函数(e){
createChart();
});
});
我希望剩下的工作是浅灰色的。我如何做到这一点
如有任何建议,将不胜感激 在中,所有图表都支持通过覆盖主题颜色。此属性将采用十六进制颜色字符串数组。例如:
$("#chart").kendoChart({
...
seriesColors: ["#7c7c7c", ... ]
});
it is an implementation from server side would be very interesting on the concept of avoiding Similar shades..please look in to the below code which iam inserting to bind the pie chart with colors
If Not radChart Is Nothing Then
radChart.PlotArea.EmptySeriesMessage.TextBlock.Text = strNoData
radChart.SkinsOverrideStyles = False
Dim seriesColors As Color() = {Color.Aqua, Color.Bisque, Color.Chartreuse, Color.Coral, Color.DarkCyan, Color.DarkKhaki, Color.DimGray, Color.Yellow, Color.LightGreen, Color.Magenta, Color.Orange, Color.Purple, Color.SaddleBrown, Color.Silver, Color.WhiteSmoke, Color.Violet, Color.RosyBrown, Color.Olive, Color.Navy, Color.IndianRed}
Dim seriesPalette As New Palette("seriesPalette", seriesColors, True)
radChart.CustomPalettes.Add(seriesPalette)
radChart.SeriesPalette = "seriesPalette"
radChart.DataBind()
End If