Indicator Trace Domain

Can anyone explain what the domain field is doing? The example below has 3 stacked bullet indicators. I want to add a 4th. It seems the X value stays the same. The Y value changes, when I add to the Y values the 4th bullet indicator starts overlapping and changing sizes.

I’ve played around with it using a single indicator to try and understand what it does and I’m not getting it. Can anyone help? What should the Y values be if you want to have 4 indicators?

import plotly.graph_objects as go

fig = go.Figure()

fig.add_trace(go.Indicator(
mode = “number+gauge+delta”, value = 180,
delta = {‘reference’: 200},
domain = {‘x’: [0.25, 1], ‘y’: [0.08, 0.25]},
title = {‘text’: “Revenue”},
gauge = {
‘shape’: “bullet”,
‘axis’: {‘range’: [None, 300]},
‘threshold’: {
‘line’: {‘color’: “black”, ‘width’: 2},
‘thickness’: 0.75,
‘value’: 170},
‘steps’: [
{‘range’: [0, 150], ‘color’: “gray”},
{‘range’: [150, 250], ‘color’: “lightgray”}],
‘bar’: {‘color’: “black”}}))

fig.add_trace(go.Indicator(
mode = “number+gauge+delta”, value = 35,
delta = {‘reference’: 200},
domain = {‘x’: [0.25, 1], ‘y’: [0.4, 0.6]},
title = {‘text’: “Profit”},
gauge = {
‘shape’: “bullet”,
‘axis’: {‘range’: [None, 100]},
‘threshold’: {
‘line’: {‘color’: “black”, ‘width’: 2},
‘thickness’: 0.75,
‘value’: 50},
‘steps’: [
{‘range’: [0, 25], ‘color’: “gray”},
{‘range’: [25, 75], ‘color’: “lightgray”}],
‘bar’: {‘color’: “black”}}))

fig.add_trace(go.Indicator(
mode = “number+gauge+delta”, value = 220,
delta = {‘reference’: 200},
domain = {‘x’: [0.25, 1], ‘y’: [0.7, 0.9]},
title = {‘text’ :“Satisfaction”},
gauge = {
‘shape’: “bullet”,
‘axis’: {‘range’: [None, 300]},
‘threshold’: {
‘line’: {‘color’: “black”, ‘width’: 2},
‘thickness’: 0.75,
‘value’: 210},
‘steps’: [
{‘range’: [0, 150], ‘color’: “gray”},
{‘range’: [150, 250], ‘color’: “lightgray”}],
‘bar’: {‘color’: “black”}}))
fig.update_layout(height = 400 , margin = {‘t’:0, ‘b’:0, ‘l’:0})

fig.show()

I seemed to have gotten closer…it looks like there is vertical space defined as 0 to 1. The Y value specifies the bottom and the top of that indicator.

You have to fit all your indicators between 0 and 1.

indicator one - .0 .2
indicator two - .3 .5
etc

That is annoying. Where is the “auto space” config?

Hi @twessels

It seams that your question is related with Plotly, but you taged “Dash”, you will receive more visits from Plotly experts if you tag it with “Plotly”.

And use the botton </> in the menu to insert your code:

image