Skip to content

Annotation autorange on category axes #1768

Closed
@alexcjohnson

Description

@alexcjohnson

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsomething broken

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions