0
votes

I am looking to change the options of a Kendo chart after the initial load and I am not sure exactly how to do this.

A simple example of what I am trying to do is as follows. Let's say we have an object literal with all of our options in it. I will use the categoryAxis option provided by Kendo as an example:

var myKendoOptions = {
    categoryAxis: {
        categories: [5, 6]
    }
}

Pretty straight forward right? You can pass these options to your chart and they will work.

However, I can't seem to find any documentation on being able to change those values in the categories object if I want to do it at a later time after the chart has loaded.

I have seen Kendo.datasource but I am not sure this is what I want.

Is there anyway to do this?

3

3 Answers

2
votes

This code should work for you:

$("#chart").data("kendoChart").options.categoryAxis = { categories: [7, 8] }
$("#chart").data("kendoChart").redraw();
0
votes

Hm, I don´t know if this work, but you can give a try

$("#myChart").kendoChart().options...;

$("#myChart").data("kendoChart").refresh();
0
votes

I believe the answer is the setOptions method

eg $('#chart').setOptions({...})

Which then redraws or refreshes.