# Fitting function with plotly.js

**URL:** <https://community.plotly.com/t/fitting-function-with-plotly-js/1851>\
**Category:** plotly.js\
**Created:** [August 16, 2016, 3:05am UTC](https://community.plotly.com/t/fitting-function-with-plotly-js/1851 "2016-08-16T03:05:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![liuxdxiaodong](https://avatars.discourse-cdn.com/v4/letter/l/a8b319/32.png) [@liuxdxiaodong](https://community.plotly.com/u/liuxdxiaodong)\
**Post date:** [August 16, 2016, 3:05am UTC](https://community.plotly.com/t/fitting-function-with-plotly-js/1851/1 "2016-08-16T03:05:39Z")

</div>

I have a problem that I want to plot a fit line for scatter points using plotly.js, but which function can I use in the plotly.js

---

<div class="post-metadata">

**Author:** ![jack](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jack/32/11_2.png) [@jack](https://community.plotly.com/u/jack)\
**Post date:** [August 16, 2016, 6:54am UTC](https://community.plotly.com/t/fitting-function-with-plotly-js/1851/2 "2016-08-16T06:54:29Z")

</div>

Curve fitting is not part of Plotly.js. You would have to write your own curve fitting routine in JavaScript, or use another curve fitting library.
