Spokes mis-aligned in Rose charts

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 Joseph on 14th January 2013
Using current RGraph stable dated 31st December 2012.
----------------------------------------------------
The John/Julie/Richard/etc. rose chart example on this page www.rgraph.net/examples/rose.html looks fine because the circle is divided into 8 segments. However, if one has a different number of segments, the spokes are not automatically aligned with the segments, even if we set the number of spokes (n) to be the same as the number of segments in rose.Set("chart.background.grid.spokes", n). See screenshot #1 (on the left) at rezeau.info/forums/14-01-2013%2015-36-50.jpg.

To have spokes strictly aligned with segments, I suggest a small hack of the RGraph.Rose.js library:
319c319
< //this.context.moveTo(this.centerx + i, this.centery);
---
> this.context.moveTo(this.centerx + i, this.centery);
337c337
< for (var i=num; i<360; i+=num) {
---
> for (var i=-90; i<360 + num; i+=num) {

See result on screenshot #2 (on the right) at rezeau.info/forums/14-01-2013%2015-36-50.jpg.
Posted by RGraph support on 14th January 2013
Hi,

Seems that the alignment may be off by 90 degrees - I'll look into this.

Richard, RGraph Support
Posted by Joseph on 14th January 2013
Correct URL for the screenshots illustrating my previous message is at:
rezeau.info/forums/14-01-2013%2015-36-50.jpg
Posted by RGraph support on 14th January 2013

Thanks!

Add a reply




« Back to message list