动态更改Kendo图表图例以应用自定义颜色取消选择
答案 0 :(得分:0)
$("#chart").kendoChart({
series: [
{ data: [6, 2, 3], name: "Task 1" },
{ data: [1, 5, 2], name: "Task 2" }
],
legendItemClick: function(e){
e.sender.options.legend.inactiveItems.markers.color = "red";
}
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Kendo UI Snippet</title>
<script src="https://kendo.cdn.telerik.com/2018.3.911/js/kendo.all.min.js"></script>
</head>
<body>
<div id="chart"></div>
</body>
</html>
$("#chart").kendoChart({
series: [
{ data: [6, 2, 3], name: "Task 1" },
{ data: [1, 5, 2], name: "Task 2" }
],
legendItemClick: function(e){
e.sender.options.legend.inactiveItems.markers.color = "red";
}
});
答案 1 :(得分:0)
LoadData()
此代码行位于LegendItemClick Templet或Function。我认为....已完全使用来满足您的需求。