所以我很难弄清楚如何设置饼图/图例位置的布局。我希望图例左对齐,饼图右对齐。 40/60 百分比 -ish。
像这样:
chart = new Highcharts.Chart({
chart: {
renderTo: 'chart',
type: 'pie',
},
credits: {
enabled: false
},
title: {
text : '',
},
plotOptions: {
pie: {
shadow: false,
borderWidth: 0
}
},
tooltip: {
enabled: false
},
series: [{
data: [
{
name: "first",
y: 23
},
{
name: "second",
y: 8
},
{
name: "third",
y: 11
},
{
name: "fourth",
y: 11
},
{
name: "fifth",
y: 47
}
],
size: '100%',
innerSize: '67%',
showInLegend: true,
dataLabels: {
enabled: false
}
}]
})
最佳答案
如 API 所述,将 legend
添加到图表选项怎么样? ?
legend: {
align: 'left',
layout: 'vertical',
verticalAlign: 'top',
x: 40,
y: 0
}
呈现这个:
剩下的你可以用 CSS 样式来做
关于javascript - Highcharts donut 派/图例位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23994836/