var data = [{
values: [40, 10, 50],
marker: {
colors: ['rgba(255, 0, 0, .5)', 'rgba(110, 154, 22, .5)',
'rgba(255, 255, 255, 0)'
]
},
text: ['80%', '20%', "I'm just a white piece of pie"],
textinfo: 'text',
textposition: 'inside',
type: 'pie',
rotation: 90,
direction: "clockwise"
}];
Plotly.newPlot('myDiv1', data);
data = [{
values: [10, 40, 50],
marker: {
colors: ['rgba(255, 0, 0, .5)', 'rgba(110, 154, 22, .5)',
'rgba(255, 255, 255, 0)'
]
},
text: ['20%', '80%', "I'm just a white piece of pie"],
textinfo: 'text',
textposition: 'inside',
type: 'pie',
rotation: 90,
direction: "counterclockwise"
}];
Plotly.newPlot('myDiv2', data);
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<div id="myDiv1" style="width: 480px; height: 400px;">
</div>
<div id="myDiv2" style="width: 480px; height: 400px;">
</div>
我想我找到了API,這是增加一個「排序:假」在一個可能的解決方案。 – David