I am using ASP.NET MVC Kendo UI to create a chart through using mvc code to build the chart using Plot band but its hard coded in the example below. How can I change the plot band dynamically using the sample code provided
I made an example demonstrating how the plotBands can be changed dynamically. Please have in mind that the example is using the jQuery version, but the MVC implementation is similar as the approach is using client methods:
I have seen this example on the Telerik website. Can you help me with how I would be able to do this using client methods . Can this be done dynamically based on an event that can be added to kendo chart in MVC to change the plotBand?
answered on 18 Apr 2017, 12:19 PM
The same logic which is executed when the button is clicked can be executed on the desired event. One thing that has to be taken into account is that the Chart have to be available before executing the function.
Also, as mentioned in the documentation some of the events of the Chart are not suitable for the setOptions method as it can cause endless loops. For example, it is not recommended to use it on the dataBound and dataBinding events, as the method will fire them as well.