In a Scatter/Bubble chart the bubbles are too light

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 Jan Dirk on 24th February 2016
I have a Scatter graph with Bubbles.
The bubbles have a max with of 25:

     var bubble = new RGraph.Scatter.Bubble(
                        scatter,
                        minValue, // Minimum
                        maxValue, // Maximum
                        25, // Max width
                        bubbleSizes, // Bubble data
                      ).draw();

My largest bubble does have a gradient, from the outside with the specified color towards a white glance. This one is okay.
However, the smaller bubbles are almost completely white.

I could fix this by changing one small thing in the Draw function of Scatter.Bubble (in RGraph.scatter.js):

                         co.fillStyle = RG.RadialGradient(obj,
                                                               obj.coords[0][i][0] + (r / 2.5),
                                                               obj.coords[0][i][1] - (r / 2.5),
                                                               0,
                                                               obj.coords[0][i][0] + (r / 2.5),
                                                               obj.coords[0][i][1] - (r / 2.5),
                                                               50,
                                                               'white',
                                                               obj.data[0][i][2] ? obj.data[0][i][2] : obj.properties['chart.defaultcolor']
                                                              );

into

                         co.fillStyle = RG.RadialGradient(obj,
                                                               obj.coords[0][i][0] + (r / 2.5),
                                                               obj.coords[0][i][1] - (r / 2.5),
                                                               0,
                                                               obj.coords[0][i][0] + (r / 2.5),
                                                               obj.coords[0][i][1] - (r / 2.5),
                                                               r,
                                                               'white',
                                                               obj.data[0][i][2] ? obj.data[0][i][2] : obj.properties['chart.defaultcolor']
                                                              );


The patch is:

@@ -2629,7 +2629,7 @@
                                                                0,
                                                                obj.coords[0][i][0] + (r / 2.5),
                                                                obj.coords[0][i][1] - (r / 2.5),
- r,
+ 50,
                                                                'white',
                                                                obj.data[0][i][2] ? obj.data[0][i][2] : obj.properties['chart.defaultcolor']
                                                               );
Posted by Richard on 24th February 2016
Hi,

Thanks - I've added that in and it should now be part of the next version.




Richard

Add a reply




« Back to message list