Skip to content

Indicator domain doesn't work in make_subplots() #4710

Open
@scattered-development

Description

@scattered-development

There seems to be a bug with the Indicator class domain/position when used in make_subplots()

I am trying to vertically position 2 indicators in a subplot, so that I have one above the other, but is not working.

Example below is adapted from the indicator example on the plotly website

I also tried { 'type ' : 'domain' } as I read this this might be the issue

version plotly = 5.23

fig made in Jupyter Notebook

from plotly.subplots import make_subplots
import plotly.graph_objects as go

fig = make_subplots(
    rows=2, cols=2,
    specs=[ [{"type": "indicator"},{"type": "indicator"}] ,
           [{"type": "indicator"}, {"type": "indicator"}], 
          ]
    ,
)

fig.add_trace(go.Indicator(
    mode = "number+delta",
    value = 200,
    domain = {'x': [0, 0.5], 'y': [0, 0.5]},
    delta = {'reference': 400, 'relative': True, 'position' : "top"}), 
             col =1, 
             row = 1,
             )

fig.add_trace(go.Indicator(
    mode = "number+delta",
    value = 350,
    delta = {'reference': 400, 'relative': True},
    domain = {'x': [0.5, 1], 'y': [0.5, 1]}), 
              col =1, 
             row = 1,
             
             )

fig.add_trace(go.Indicator(
    mode = "number+delta",
    value = 450,
    title = {"text": "Accounts<br><span style='font-size:0.8em;color:gray'>Subtitle</span><br><span style='font-size:0.8em;color:gray'>Subsubtitle</span>"},
    delta = {'reference': 400, 'relative': True},
    domain = {'x': [0.6, 1], 'y': [0, 1]}), 
              col =2, 
             row = 2,
             )

fig.show()

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3backlogbugsomething broken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions