I'm trying to get a responsive Meter chart

Share RGraph:   Share or Like RGraph on Facebook!

« Back to message list

Enter your email address to get email updates on this topic. You can stop receiving updates by clicking the link in the update email messages.

Posted by Florian on 17th August 2017
Hello,

I am currently trying to get a responsive meter Chart, but getting only scatchy warped results.

Im trying a function like this:

         var customWidth = $(window).width() * 0.6,
             customHeight = $(window).width() * 0.25;

         RGraph.Reset(canvas1);
         RGraph.Reset(canvas2);
         RGraph.Reset(canvas3);

         canvas1.width = customWidth;
         canvas1.height = customHeight;

         canvas2.width = customWidth;
         canvas2.height = customHeight;

         canvas3.width = customWidth;
         canvas3.height = customHeight;

         canvas1.__rgraph_aa_translated__ = false;
         canvas2.__rgraph_aa_translated__ = false;
         canvas3.__rgraph_aa_translated__ = false;

        
         meter1 = new RGraph.Meter(options1);
         meter2 = new RGraph.Meter(options2);
         meter3 = new RGraph.Meter(options3);

         RGraph.Redraw();

Thanks in advance for any help!

Florian

Posted by Richard on 17th August 2017
Hi there,

> customHeight = $(window).width() * 0.25;

Should that be $(window).height() ?


Also set textAccessible to false - so that the canvas isn't wrapped in a DIV. And put a (concise) demo online so that a can see what's happening.



Richard

Add a reply




« Back to message list