This is a migrated thread and some comments may be shown as answers.

Resizing the chart on pages resizes

3 Answers 1436 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Ignacio
Top achievements
Rank 1
Ignacio asked on 13 Nov 2012, 03:41 PM
Hi,

I want that the chart to be re sized based following the browser window. I tried this code but it does not work:

jQuery(window).resize(function () {
                        control.kendoChart.refresh();
                    });
The biggest problems I have is in decreasing the size as it breaks my page layout, increasing the size keep the layout but the chart is not re sized either

I've seen possible solutions like http://www.telerik.com/community/forums/aspnet-mvc/chart/resizing-chart-on-browser-resize.aspx
but this does not work in my case as I do not have a prefixed size.

Thank for your help,
Ignacio

3 Answers, 1 is accepted

Sort by
1
Iliana Nikolova
Telerik team
answered on 13 Nov 2012, 08:49 PM
Hi Ignacio,

In order to achieve the desired behavior you need to call the refresh() method of the client object. Like here: 
$(window).resize(function(){
    $("#chart").data("kendoChart").refresh();
});


Regards,
Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
jerry
Top achievements
Rank 2
answered on 11 Feb 2013, 07:14 PM
I used the script.  It works.  Thanks.

One additional point, this should be the default behavior, adding it on should not have been required.
0
Iliana Nikolova
Telerik team
answered on 13 Feb 2013, 11:36 AM
Hello Jerry,

Thank you for the feedback. We will consider it for future versions of the product.
 
Regards,
Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Charts
Asked by
Ignacio
Top achievements
Rank 1
Answers by
Iliana Nikolova
Telerik team
jerry
Top achievements
Rank 2
Share this question
or