Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding gradient information for the trendline #58

Open
volokh1 opened this issue Sep 7, 2021 · 2 comments
Open

Adding gradient information for the trendline #58

volokh1 opened this issue Sep 7, 2021 · 2 comments

Comments

@volokh1
Copy link

volokh1 commented Sep 7, 2021

I have added the trendline, but the most interesting information for me is its slope/gradient. Could it possible to make this information available so I can not only draw the trendline but also display the value of its gradient?

Thanks a lot!

@Makanz
Copy link
Owner

Makanz commented Oct 17, 2021

I don´t have any plans to add this information but feel free to contribute with a PR if you have the possibility.

@shkuviak
Copy link
Contributor

I think that you can access it via the scale property:

scale: function () {
var det = this.count * this.sumX2 - this.sumX * this.sumX;
var scale = (this.count * this.sumXY - this.sumX * this.sumY) / det;
return scale;
},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants