A combined Scatter Chart

This chart combines two scatter charts, where the first and second chart's data is retrieved from the same file.

Data for the second scatter chart is built by rchart's built in regression calculation. This function does a basic regression analysis and provides the caculated formula and data of this analysis. Together with the regression formula also the calculated coefficient of determination as "R2" is displayed. The coefficient of determination is the proportion of variability in the data that is accounted for by the calculated formula and it will range from "0" (no correlation) to "1" (perfect correlation).

To combine these two scatter charts, parameter "combine_chart" is set to "true". This causes that second chart is drawn into the same canvas as first chart as both charts use the same id ("cvs"). It is important that both charts have the same scale (see "width", "height", "xmax", "ymax", "xmin" and "ymin").

 

[No canvas support]>

Parameter for creation of chart 1.

{rgraph type="Scatter" width="550" height="400" 
data="file" file="plugins/content/rgraph/doc/scatterdata.json" 
title="Body Size versus Length of Arms" defaultcolor="red" gutterBottom="80" tickmarks="circle"
backgroundGridAutofitNumvlines="10" xmin="150" xmax="201" ymin="150" ymax="200" unitsPost=" cm"
titleYaxis="Body Size" titleXaxis="Length of Arms in cm" x_step="2"}cvs{/rgraph}   

Parameter for creation of chart 2.

{rgraph type="Scatter" data="file" file="plugins/content/rgraph/doc/scatterdata.json"
gutterBottom="80" combine_chart="1" xmax="201" ymin="150" ymax="200"
x_step="2" tickmarks="null"  noaxes="true" ylabels="false" 
calculate_regression="1" show_regression_formula="1" line="true" keyPositionY="175"}cvs{/rgraph}  

 

Important: If you want to test this sample via copy/paste, ensure that you paste with option "paste as plain text" otherwise imbedded html-codes may invalidate your input.
go back...

Visitors

Today: 19
Yesterday: 17
This Week: 19
Last Week: 121
This Month: 363
Last Month: 680
0146464
United States 35.5% USA
Germany 13.2% Germany
Russia 4.7% Russia
France 3.3% France
Indonesia 2.6% Indonesia
Italy 2.6% Italy
India 2.5% India
Poland 2.2% Poland

Total:

204

countries
Cookies make it easier for us to provide you with our services. With the usage of our services you permit us to use cookies.
Ok