0

I'm trying to create a scatter graph using Highcharts. There's a sample that shows how to add a trend line. However, I don't see anywhere where we could add the equation and the r-squared value like what we normally do in Excel.

Thanks!

Owen
  • 4,063
  • 17
  • 58
  • 78
  • Please check if [this](http://stackoverflow.com/questions/20194770/highcharts-area-range-plot-in-rcharts) is what you are looking for. Is it also related to javascript(you added the tag)? – Rao Jan 25 '16 at 06:16
  • yes. highcharts is an interactive javascript chart... – Owen Jan 25 '16 at 06:20
  • 2
    You need to calculate values - by default Highcharts won't calculate this for you. I think you need [Highcharts-Regression](http://www.highcharts.com/plugin-registry/single/22/Highcharts%20regression) plugin. – Paweł Fus Jan 25 '16 at 09:28
  • Hi Pawel. I took a look at the plugin you gave me. Equation is readily available. The R squared value is also available via the cofiguration. Thanks a lot for the help! It works like a charm! :D – Owen Jan 25 '16 at 11:43

1 Answers1

-1

In order to show the r squared value:

https://github.com/streamlinesocial/highcharts-regression/issues/38

As per phpepe:

Add "%r2" to the legend and will replaced with the calculated value. You can add the equation as well as shown in the examples.

beerwin
  • 9,813
  • 6
  • 42
  • 57
Gert
  • 39
  • 4