Skip to content

Annotation autorange on category axes #1768

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

Closed
alexcjohnson opened this issue Jun 8, 2017 · 4 comments · Fixed by #1791
Closed

Annotation autorange on category axes #1768

alexcjohnson opened this issue Jun 8, 2017 · 4 comments · Fixed by #1791
Labels
bug something broken
Milestone

Comments

@alexcjohnson
Copy link
Collaborator

Annotation autorange is broken if you position the annotation using the category names for positioning, rather than the category serial number.

Plotly.newPlot(gd, [{x: ['a', 'b'], y: ['c', 'd']}], {
    annotations:[{x: 1, y: 1, ax: 30, ay: -30, text: 'boo!'}],
    width: 300,
    height: 300,
    paper_bgcolor:'#ffc'
})

works:
screen shot 2017-06-08 at 12 50 03 pm

but if I change to category names:

Plotly.newPlot(gd, [{x: ['a', 'b'], y: ['c', 'd']}], {
    annotations:[{x: 'b', y: 'd', ax: 30, ay: -30, text: 'boo!'}],
    width: 300,
    height: 300,
    paper_bgcolor:'#ffc'
})

it fails to include the annotation in autorange:
screen shot 2017-06-08 at 12 51 31 pm

@alexcjohnson alexcjohnson added the bug something broken label Jun 8, 2017
@etpinard
Copy link
Contributor

etpinard commented Jun 14, 2017

This appears to be working fine in 1.27.1: https://codepen.io/etpinard/pen/ZypqJz?editors=1010

@etpinard
Copy link
Contributor

PR #1748 strikes again. Not sure why annotations.json didn't produce a diff.

@etpinard
Copy link
Contributor

Blocking for 1.28.0

@alexcjohnson
Copy link
Collaborator Author

The mock to include this in is annotations-autorange.json - make one of the axes categorical and use the category names for a couple of the positions on that axis.

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

Successfully merging a pull request may close this issue.

2 participants