Resizing the canvas


« 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 sudarshan on 23rd May 2016
How to change the canvas width and height dynamically i am using more data to get pie and bar charts.So can any one please help me.(simply i want to increase the canvas according to the my data)
Posted by Richard on 23rd May 2016
Hi there,

That can be done quite easily - but keep in mind that when you resize the canvas its cleared automatically by the browser - so you'll need to call the RGraph redraw function:




document.getElementById('cvs').width = 600;
document.getElementById('cvs').height = 200;

RGraph.redraw();








Richard

Posted by sudarshan on 24th May 2016
Hi

Thanks for quick reply,

I am done with the increasing canvas.

I got another problem in PIE charts

I am drawing pie charts it is based on categories..

I draw 2,3,4 up to 5

drawn charts successfully but coming to labels i want to insert Legend chart for the labels.It's showing 5 different legend charts i don't want 5 charts.All the labels should be in only one chart it is possible?
why i am choose legend chart to reduce overlapping in labels so is there any alternative way please tell me any chart is ok i.e legend or labels but i need to reduce the overlapping...

please help me.....
Posted by Richard on 24th May 2016
Hi,

Yes you can have fewer key items than chart segments:

www.rgraph.net/fiddle/view.html/a-pie-chart-making-use-of-a-key


The key is currently the only why to completely avoid overlapping labels with the Pie chart.




Richard
Posted by Richard on 24th May 2016
Hi,

It should also be noted that I'm trying a new layout system for Pie chart labels and you can see a demo of it on the RGraph Facebook page:

www.facebook.com/rgraph






Richard

Add a reply

 




« Back to message list
RGraph on social media