Just like a similar question asked here, I would like to change the order of the legend of a plotly pie chart. The difference is that I can't simply use traceorder
since I have more than 6 labels and reversing them doesn't put them in the right order.
Is there a way to customize the order?
As an example with 4 labels:
import plotly.offline as py
trace1 = go.Pie(
values = [2, 4, 4, 9],
labels = ['A', 'B', 'C', 'D'],
name = "Succes"
)
data = [trace1]
fig = go.Figure(data = data)
py.plot(fig)
I would like to prespecify the order of the legend.