Resize chart on resize browser

by annlee » Mon May 09, 2016 6:29 pm

Hi,

Is there a way to make the chart resize as you resize the browser? Instead of refreshing the page to get the new size.

I have my chart's width set at 100%.

Thanks,
ann
annlee
 
Posts: 35
Joined: Thu Oct 08, 2015 3:25 pm

by Rostislav » Tue May 10, 2016 10:31 am

1. Set the size to 100% x 100%
2. In Dashboard -> Advanced your code will look like this:

Code: Select all
var handlers = {};
handlers.preRender = function(config, logger, processor, el) {
  logger.debug('Configuration: ', config);
  $(window).resize(function(){
    el.data("kendoChart").redraw();
  });
  return true;
}
User avatar
Rostislav
 
Posts: 61
Joined: Fri Oct 09, 2015 10:51 am


Return to Dashboard Designer for SharePoint 2013