Bug: Incorrect labels are shown when using an X scale and a minimum X value in a Scatter chart

« 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

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.

- 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
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