Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable interactive legend of a pie chart in Kendo UI Charts?

I have craete KendoChart pie with legend. For some reason legend by default is interactive and by clicking on legend items chart enables/disables pieces of the pie.

I didn't find any way to disable this behavior: http://docs.telerik.com/kendo-ui/api/dataviz/chart

enter image description here

Could it be disabled?

like image 744
Alexey Strakh Avatar asked Apr 23 '14 20:04

Alexey Strakh


2 Answers

I needed to do the same thing and after some research found out in the Kendo UI documentation the following solution: - hook to the legendItemClick and legendItemHover events of the chart - in the handler call e.preventDefault();

Here is the code I used (MVVM-style):

In HTML:

data-bind="events: { legendItemClick: disableEvent, legendItemHover: disableEvent } "

In the ViewModel:

disableEvent: function(e) {
    e.preventDefault();
}

Here is the article - http://docs.telerik.com/kendo-ui/api/dataviz/chart

like image 87
Miroslav Nedyalkov Avatar answered Oct 15 '22 18:10

Miroslav Nedyalkov


Use the code Below

legend: {
    position: "bottom",
    visible: false
},
like image 37
Abiola Avatar answered Oct 15 '22 17:10

Abiola