3

I need Chartkick line chart to be always square form, no matter what screen size is. I know that I can put width and height directly, but If I put 400x400 for example, it always will be that size, no matter what screen resolution is. But I need it to be responsive.

tetiross
  • 192
  • 3
  • 17
  • for a responsive chart, you'll need to listen for the resize event and re-draw the chart accordingly, here is a working JavaScript example --> [Resizing google visualization](http://stackoverflow.com/a/32523331/5090771) – WhiteHat May 09 '16 at 12:50

1 Answers1

0

For responsive you have to use a responsive style sheet.

example: http://www.w3schools.com/html/html_responsive.asp

I have another suggest get window size and adjust your chart with window size.

$(document).ready(function(){
 alert($(window).width());
  alert($(window).height());
});
 <script src="//code.jquery.com/jquery-1.10.2.js"></script>
Farhad
  • 4,119
  • 8
  • 43
  • 66