(kendoUI chart) Can I pay for its size using the resize window?

Here are the pie chart settings:

function createChart(chartDataSource) {
    $("#chart").kendoChart({
        theme:$(document).data("kendoSkin") || "black",
        title:{
            text:"Efficiency"
        },
        legend:{
            position:"bottom"
        },
        dataSource:chartDataSource,
        series:[
            {
                type:"pie",
                field:"val",
                categoryField:"status"
            }
        ],
        tooltip:{
            visible:true,
            template:"${category} - #= kendo.format('{0:P}', percentage)#"
        }
    });

CSS style:

#chart {
    width: 50%;
    height: 50%;
    }

I know that Highcharts has a reflowboolean ( https://stackoverflow.com/a/9/348/ ) did exactly what I want.

I'm not sure if the kendoUI table has the same reflow setting, or should I play with CSS style. If you go for CSS, how to make such a setting?

thank

+5
source share
1 answer

Applying my idea in a related post, just pin the window resize event and redraw the chart:

$(window).resize(function() 
{    
    var chart = $("#chart").data("kendoChart");
    chart.refresh();
});

The working script is here .

+8
source

All Articles