I am desperately trying to find a way to display KPIs type of information inside a dashboard. Plotly Indicators seemed to be a great way to achieve what I wanted, it turned out not so much. I am not only interested in displaying number KPIs but also values.
I have found a somewhat hacky way to achieve this, which is to play with the โsuffixโ parameter of the number field of the go.Indicator function. However, my question is how can I change the color of the suffix, as well as change the color of the value in order to hide whenever the KPI is not a numerical value.
I think that an example would make much more sense. Here is an example of a situation where I would like to specify the value (being 1) to be white so it is hidden from the output.
topchoicename = go.Figure()
topchoicename.add_trace(go.Indicator(
mode="number",
number={"font": {"size": 15},"suffix":top_choice['CarrierName'].iloc[0]},
value=1,
gauge={'shape': "bullet"},
domain={'x': [0, 1], 'y': [0, 1]},
))
topchoicename.update_layout(paper_bgcolor="rgba(0,0,0,0)",
plot_bgcolor="rgba(0,0,0,0)",
autosize=False,
width=150,
height=20,
)
topchoicename.update_traces(align="center", selector=dict(type='indicator'))
I donโt know how to do that and I have found anything helpful in the doc. Thanks in advance guys!