plotly / plotly/plotly.js

add trendlines in Plotly.js

Open
#4,921 6 comments 32 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature P3
Dominant language
JavaScript
Stars
18.3k
Forks
2k
Avg merge
2d 12h
Merged PRs (30d)
28

Description

Looking through the documentation of Plotly I came across the trend line possibilities in Plotly.py: https://plotly.com/python/linear-fits/
I'm searching for a feature within Plotly.js to draw a trend line/regression line/fitting within a scattered graph. Though it looks like this feature is not available in the JavaScript version of Plotly.

The requests for such a feature have already been there within the community for some time but the answer was to generate it elsewhere. I am using Plotly within Mendix and using other libraries to create something for Plotly is not really a well maintainable solution there.
https://community.plotly.com/t/fitting-function-with-plotly-js/1851
https://community.plotly.com/t/linear-regression-in-scatterplot/8669

Would it be a possibility to add trend lines as a feature within Plotly.js?
Something like this would be great as an example:
https://developers.google.com/chart/interactive/docs/gallery/trendlines

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the Plotly.py linear-fits documentation and the linked Plotly community discussions, then compare the Google Charts trendlines example. The issue names no Plotly.js files or tests; scope would need to be defined for a supported trendline or regression feature in scatter plots, including how completion would be verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data-visualization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.