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").

 

Parameter for creation of chart 1.

{rgraph type="Scatter" width="600" height="400" data="file" file="plugins/content/rgraph/doc/scatterdata.json"
title="Body Size versus Length of Arms" marginLeft="80" backgroundGridAutofit="false" xaxisScaleMin="150"
xaxisScaleMin="150" xaxisScaleMax="203" yaxisScaleMin="150" yaxisScaleMax="200" yaxisScaleUnitsPost=" cm"
yaxisTitle="Body Size" xaxisTitle="Length of Arms in cm" x_step="2" yaxisTitlePos="0.30"}cvs{/rgraph}

Parameter for creation of chart 2.

{rgraph type="Scatter" width="600" height="400" data="file" file="plugins/content/rgraph/doc/scatterdata.json" marginLeft="80" combine_chart="1"  xaxisScaleMin="150" xaxisScaleMax="203" yaxisScaleMin="150" yaxisScaleMax="200" x_step="2" yaxisTickmarks="false"  calculate_regression="1" line="true" show_regression_formula="1"  keyPositionY="175" linewidth="2" xaxis="false" yaxis="false" xaxis="0" xaxisLabels="" yaxisLabelsCount="0" backgroundGrid="false" tickmarksStyle="null" scaleDecimals="2"  xmax="203" ymin="150"  ymax="200"}cvs{/rgraph}   

 

[No canvas support]>

 

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: 7
Yesterday: 33
This Week: 156
Last Week: 590
This Month: 1,279
Last Month: 2,235
This Year: 6,644
Total: 239,237
0239237
Germany 30.9% Germany
USA 22.8% USA
France 3.3% France
Italy 2.7% Italy
Indonesia 2.1% Indonesia
Poland 2.0% Poland
Netherlands 1.8% Netherlands

Total:

209

Countries

Weather

Weather in Franklin

18th April, 2024 - 22:38
Scattered Clouds
61°F 58°F min 64°F max
6:50 20:12
Humidity: 72 %
Wind: 9.2 mph West
Pressure: 1,018 hPa
Visibility: 32,808 ft
We use cookies

We use cookies on our website. Some of them are essential for the operation of the site, while others help us to improve this site and the user experience (tracking cookies). You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.