Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Responsive? #56

Open
ryanbelisle opened this issue Oct 30, 2013 · 10 comments
Open

Responsive? #56

ryanbelisle opened this issue Oct 30, 2013 · 10 comments
Assignees

Comments

@ryanbelisle
Copy link

Is the Chart Responsive?

I tried setting the width & height of the canvas element as well as it's div container to smaller sizes as resolutions decrease. It works fine in Chrome, but if I open it up on my iPhone the size doesn't change.

Any suggestions?

@ghost ghost assigned rendro Jan 29, 2014
@polikin
Copy link

polikin commented Mar 17, 2014

+1 for responsive

@paulobranco
Copy link

+1 responsive

@mrzmyr mrzmyr added this to the 2.2.0 milestone May 6, 2014
@nunosilva800
Copy link

+1 for responsiveness, or a way to re-draw the chart in AngularJS

@keown
Copy link

keown commented Aug 21, 2014

+1 responsive

@Iknuts
Copy link

Iknuts commented Mar 23, 2015

+1 for responsive? im lost

@rendro rendro removed this from the 2.2.0 milestone May 8, 2015
@danpadua
Copy link

+1 for responsive

@Smashr
Copy link

Smashr commented Feb 22, 2016

+1 for responsive ... or percentage size.

@g-javi
Copy link

g-javi commented Apr 29, 2016

👍

1 similar comment
@tceydeliler
Copy link

+1

@pixedelic
Copy link

pixedelic commented Aug 22, 2016

I'm using this as workaround. Not an elegant solution maybe, but it works for me:

var $chart = $('.amount-chart'),
    size = parseFloat( $chart.outerWidth() ),
    clearSet;

$chart.easyPieChart({
    size: size,
    animate: 2000
});

$(window).on('resize', function(){

   size = parseFloat( $chart.outerWidth() );

   $chart.css({
      height: size
   });

   clearTimeout(clearSet);
   clearSet = setTimeout(function(){
      $chart.removeData('easyPieChart').find('canvas').remove();
      $chart.easyPieChart({
         size: size,
         animate: 1
      });
   }, 100);
 });    

Here a jsfiddle example with setTimeout lines commented: https://jsfiddle.net/70vy5smy/2/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests