Kendo UI chart not resizing?

后端 未结 6 1778
温柔的废话
温柔的废话 2021-01-17 23:55

\"enter

I have a Kendo ui chart which displays a column chart from a dynamic data sour

相关标签:
6条回答
  • 2021-01-18 00:14

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

    0 讨论(0)
  • 2021-01-18 00:19

    Try this

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

    Thanks

    0 讨论(0)
  • 2021-01-18 00:22

    I fixed it by adding a small delay after calling the CreateChart() function as below:

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

    its working fine now

    0 讨论(0)
  • 2021-01-18 00:23

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

    0 讨论(0)
  • 2021-01-18 00:24

    This is what I using 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?

    0 讨论(0)
  • 2021-01-18 00:27

    This happens generally when you open a chart in a animated window before it is finished expanding.

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

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

    If you have not disabled animations you may want to do that before this and re-enable them after.

    $("#myChart").data("kendoChart").options.transitions = false;
    
    0 讨论(0)
提交回复
热议问题