Bug: Incorrect labels when using an X scale and xmin in a Scatter chart

Share RGraph:   To help my Google visibility (it can't get much worse!), if you like and use RGraph I'd appreciate it if you could link to me

« 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 Wouter on 27th June 2013
Hi,

The xmin value isn't correctly taken into account when drawing a scatter graph with an X scale (instead of X labels). I.e. in RGraph.scatter.js the call:

this.xscale2 = RG.getScale2(this, {'max':xmax,
                                    'scale.decimals': decimals,
                                    'scale.point': point,
                                    'scale.thousand': thousand,
                                    'units.pre': units_pre_x,
                                    'units.post': units_post_x,
                                    'ylabels.count': numXLabels,
                                    'strict': true
                                   });

should also include the option 'min':xmin.

Notes:
- In the code path, that's taken when a 'chart.xscale.formatter' function is set , the minimum value is correctly taken into account.
- I haven't checked if this is also an issue with other graph types.
- Both the stable 2013-06-01 and the beta 2013-06-19 version seem to have this issue.
Posted by RGraph support on 27th June 2013
Hi there,

Thanks - this will be fixed in the next beta - so feel free to test that and let me know if it works OK for you.





Richard, RGraph Support

5 developer license with Priority support for £299:
   www.rgraph.net/license#five-developer
Posted by Wouter on 27th June 2013
Hi Richard,

Thanks for the quick reply.

Turned out I was also to quick to say that code worked correctly if only 'min:xmin was added (and that it worked when 'chart.xscale.formatter' was set).

The xmin variable is only assigned in the code when 'chart.xmax' wasn't set. Moving "var xmin = prop['chart.xmin']" outside the if-test solves this additional problem. And the code still seems to work correctly even if 'chart.xmin' wasn't set.

Add a reply




« Back to message list