Необходимо отобразить несколько (10-150) пулевых диаграмм. Под каждым из 2-5 индикаторов:
Но plotly.graph_objects.Figure () ось Y имеет высоту 1 и элементы не подходят.
Можно ли как-то реализовать прокрутку так, чтобы ось Y была размером элементов?
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]}, //element location
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]}, //element location
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]}, //element location
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.add_trace(go.Indicator(
mode = "number+gauge+delta",
gauge = {'shape': "bullet"},
delta = {'reference': 300},
value = 220,
domain = {'x': [0.25, 0.35], 'y': [0.1, 0.15]}, //element location
title = {'text': "Avg order size"}))
fig.update_layout(height = 400 , margin = {'t':0, 'b':0, 'l':0})
fig.show()