如何将 highcharts 中的饼图与容器中的右端或左端对齐?我注意到 center:[] 属性使用百分比工作,但在调整容器大小时遇到一些位置问题。请检查下面的 fiddle 链接。
Highcharts.chart('container', {
chart: {
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false,
type: 'pie'
},
title: {
text: 'Browser market shares in January, 2018'
},
tooltip: {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: false
},
showInLegend: true
}
},
series: [..]
});
最佳答案
您可以为图表使用样式 属性。请看附件示例:
chart: {
plotBackgroundColor: null,
width: 200,
height: 300,
type: 'pie',
style: {
'float': 'right'
}
},
关于javascript - Highcharts : How to align pie chart positions to right or left corner of the container,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51943462/