This is a migrated thread and some comments may be shown as answers.

Make legend unclikable

1 Answer 71 Views
Chart (HTML5)
This is a migrated thread and some comments may be shown as answers.
Jérémy
Top achievements
Rank 1
Jérémy asked on 03 Jun 2015, 08:18 AM

Hi,

 

I search a lot but I don't find a way to "disable" the click event on a legend of a chart. I don't want my user could click on the legend.

 

Could you please help me ?

 

Thank

1 Answer, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 05 Jun 2015, 02:01 PM
Hi Vallin,

You can attach an event handler to the legendItemClick event and prevent the default behavior (show/hide the corresponding pie segment). You can have a similar implementation:
<telerik:RadHtmlChart runat="server" ID="PieChart" Width="800" Height="500" Transitions="true">
    ...
</telerik:RadHtmlChart>
<script type="text/javascript">
    function pageLoad() {
        //get a reference to the chart
        var chart = $find("<%=PieChart.ClientID%>");
        //attach an event handler
        chart.get_kendoWidget().bind("legendItemClick", function (e) {
            e.preventDefault();
        });
    }
</script>

I hope this approach is suitable for your scenario.

Regards,
Vessy
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Chart (HTML5)
Asked by
Jérémy
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Share this question
or