I created a pie chart (code below). The font color of the % values on top of each pie segment varies (either black or white) even though I set font to white in layout. I would like it to be white text on all pie segments.
Additionally the number of decimal places of the % values vary across the pie segments, from one decimal place to three. I would like to set it to one decimal place. Any suggestions?
I am not able to share an image of the pie chart as it has some sensitive data.
fig = dcc.Graph(
id='graph',
figure={
'data': [{
'values': df['count'],
'labels': df['labels'],
'type': 'pie'
}],
'layout': {
'margin': {'l': 30,'r': 0,'b': 30,'t': 30,},
"plot_bgcolor": "#111111",
"paper_bgcolor": "#111111",
"font": {"color": 'white'},
'legend': {'x': 0, 'y': 1},
}
}
)