This question is locked. New answers and comments are not allowed.
Hi there
I am using the MVC chart control and it is inside a div element which expands and contracts horizonatally when the browser is resized. The vertical size is fixed using the HtmlAttributes.
I have some JavaScript attached to the window resize event as follows: -
function resizeChart() {
var chart = $('#chtIssueStats').data('tChart');
chart.refresh();
};
var resizeTimer;
$(window).resize(function () {
clearTimeout(resizeTimer);
resizeTimer = setTimeout(resizeChart, 1000);
});
When the browser window is resized the script is called fine and I can see the Ajax postback for the data for the chart and therefore I know the refresh is happening. However, the image stays the same width and does not adjust to the new width of the resized div that it is hosted in.
According to the documentation the 'refresh' method is supposed to refresh the data and repaint the chart but either the repaint is not happening or it is not picking up the new width to draw with.
Can you suggest a solution please?
Regards
Paul
I am using the MVC chart control and it is inside a div element which expands and contracts horizonatally when the browser is resized. The vertical size is fixed using the HtmlAttributes.
I have some JavaScript attached to the window resize event as follows: -
function resizeChart() {
var chart = $('#chtIssueStats').data('tChart');
chart.refresh();
};
var resizeTimer;
$(window).resize(function () {
clearTimeout(resizeTimer);
resizeTimer = setTimeout(resizeChart, 1000);
});
When the browser window is resized the script is called fine and I can see the Ajax postback for the data for the chart and therefore I know the refresh is happening. However, the image stays the same width and does not adjust to the new width of the resized div that it is hosted in.
According to the documentation the 'refresh' method is supposed to refresh the data and repaint the chart but either the repaint is not happening or it is not picking up the new width to draw with.
Can you suggest a solution please?
Regards
Paul