Pie chart legend rearrangement



I am using pie chart with label array as shown in below example. Output showing legends in reverse order as shown in image. Can I rearrange it to show 1 and then 2 and 3 …?

var data = [{
values: [19, 26, 55],
labels: [‘1. label’, ‘2. label’, ‘3. label’],
type: ‘pie’

Plotly.newPlot(‘myDiv’, data);


See https://plot.ly/javascript/reference/#layout-legend-traceorder


The above answer does not help with a pie chart. Legends are ordered descending based on values… Is there really no solution to this problem??