Kendo UI schedule not changing?

enter image description here

I have a Kendo ui chart that displays a column chart from a dynamic data source. But sometimes a chart reveals half the size of the available space. When I click on some links or change the date, it changes size. Any idea why she calls it?

The data source change event shows that the width of the container div is 0 when it shows this behavior. If necessary, I can provide more detailed information.

I tried the update method as indicated in one of the answers, but not for help

+6
source share
6 answers

When you have all the necessary data in the controller, you can call the Javascript CallBack function, in which you can set the transition to false, and then redraw the diagram and set the transition to true, you can also hide the default diagram and make it visible in the Javascript function Callback

+4
source

This usually happens when you open a chart in an animated window before it is completed.

My suggestion is to redraw the chart when you are sure that everything is loaded and fully open.

$("#myChart").data("kendoChart").redraw(); 

If you do not have disabled animations, you can do this before and re-enable them after.

 $("#myChart").data("kendoChart").options.transitions = false; 
+7
source

try it

 var chart=$("#chart").data("kendoChart"); //to check the chart exist or not if exist then redraw it.. if(chart) { chart.redraw(); } 

thanks

+2
source

This is what I use for my charts:

 if($("#areaChart").data("kendoChart")) { $("#areaChart svg").width(Number($('.k-content').width())); $("#areaChart svg").height(Number($('.k-content').height())); $("#areaChart").data("kendoChart").refresh(); } 

Taken from here

Have you checked the resize () method?

+2
source

I fixed this by adding a slight delay after calling the CreateChart () function, as shown below:

 CreateChart(this.id, this.id + " this week", "week", null); sleep(1000); 

now it works great

0
source

$ ("# divSensingData"). KendoChart ({chartArea: {width: 900, height: 500},

0
source

Source: https://habr.com/ru/post/970705/


All Articles