How can I change the color of all of the points in a Scatter chart?

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 Arthur R. on 28th February 2017
Hi there. I'm new to RGraph and hope you can help me :-)

How can I change the default color of all data points in a scatter plot?

I know, that I can change this in the dataset for each point individually. But for the whole set?

Purpose:
I want to plot several datasets together and the points should have a different color for each set.
Can I do this without the need of assigning a color to *each* point in the set?

Didn't find a method in the doc, neither a solution in the forum...
Posted by Richard on 28th February 2017
Hi there,

In the SVG Scatter chart you should be able to use the colors configuration property:

...
options: {
     colors: ['red', 'green']
}
...

And in the canvas Scatter chart there's just the single defaultcolor property:

...
options: {
     defaultcolor: 'green'
}
...




Richard
Posted by Arthur R. on 1st March 2017
Thanks for the hint!

RGraph.Scatter( { ... options: { defaultcolor: 'green' } ... } );

works fine. :-)

Add a reply




« Back to message list