gpt4 book ai didi

javascript - Highcharts donut 派/图例位置

转载 作者:行者123 更新时间:2023-11-30 07:04:43 25 4
gpt4 key购买 nike

所以我很难弄清楚如何设置饼图/图例位置的布局。我希望图例左对齐,饼图右对齐。 40/60 百分比 -ish。

像这样:

enter image description here

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
}

呈现这个:

enter image description here

剩下的你可以用 CSS 样式来做

关于javascript - Highcharts donut 派/图例位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23994836/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com