Julien Denos
Julien Denos

Reputation: 109

Plotly indicators number rounding

When using Plotly (in python) with an indicator if the number is relatively big the number is rounded. How to avoid this (or at least control it)?

fig_ind_abs = go.Figure(go.Indicator(
        mode="number+delta",
        value=5222,
        delta={'position': "top", 'reference': 5218}))

will show the following indicator Result

Any ideas?

Upvotes: 2

Views: 4742

Answers (1)

Equinox
Equinox

Reputation: 6758

You need to format the indicator number. You should add {'valueformat':'f'} to your code wherever you need float values.Reference

Full list of available customizations d3 format api

import plotly.graph_objects as go
go.Figure(go.Indicator(
        mode="number+delta",
        value=5222,
        delta={'position': "top", 'reference': 5218, 'valueformat':'f'},
        number = {'valueformat':'f'}
))

enter image description here

Upvotes: 7

Related Questions