How can I annotate with text at every step on circumference of gauge ?
def create_gauge_chart(value, range_dict):
# Sort the dictionary by values (ranges)
sorted_ranges = sorted(range_dict.items(), key=lambda x: x[1])
# Define colors for each range
colors = create_color_list(list(price_meter_range.values()))
steps = []
for i in range(len(sorted_ranges) - 1):
key1, range_value1 = sorted_ranges[i]
key2, range_value2 = sorted_ranges[i + 1]
steps.append({'range': [range_value1, range_value2], 'color': colors[i]})
fig = go.Figure(go.Indicator(
domain = {'x': [0, 1], 'y': [0, 1]},
value = value,
mode = "gauge+number+delta",
title = {'text': "Speed"},
delta = {'reference': range_dict['IDX_D1']},
gauge = {'axis': {'range': [range_dict['IDX_M0'], range_dict['IDX_M1']]},
'steps': steps,
'threshold': {'line': {'color': "red", 'width': 4}, 'thickness': 0.75, 'value': max(range_dict.values())}}
))
return fig