Skip to content

Support trendline annotations #601

Closed
@mdfederici

Description

@mdfederici

I would like to be able to leverage annotations to specify a trendline like so:
image
I can do this with the current annotation code leveraging 'ax' and 'ay' but it is a bit clunky (as i need to convert a point on the graph to pixels outside of plotly) and does not work correctly when the plot is zoomed.

How I imagine this working is a flag in the options which when set to true tells the annotation code to interpret 'ax' and 'ay' not as an offset in pixels but rather an absolute point in the coordinate system which indicates the position of the tail (while x,y continues to represent the head as usual). This would make it easier to draw the trendline and the trendline would correctly scale with zoom like so:
image

I've never contributed to plot.ly before but I've implemented this in my plotly fork and have a pull request there (in accordance with the contributing guidelines).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions