如何在取消选择时更改剑道图表图例项目的颜色?

时间:2018-09-22 07:35:49

标签: model-view-controller kendo-ui

动态更改Kendo图表图例以应用自定义颜色取消选择

2 个答案:

答案 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。我认为....已完全使用来满足您的需求。