gpt4 book ai didi

jquery - 如何使用 Highcharts 更改整个 xAxis 标签的高度?

转载 作者:行者123 更新时间:2023-11-28 06:54:00 25 4
gpt4 key购买 nike

如何使用 Highcharts 仅更改 3D 柱形图上 xAxis 标签区域的高度?我发现了一些声称可以执行此操作但实际上并未执行的线程。请让我知道哪里出了问题...

   $(document).ready(function() {
var options = {
// basic chart options
chart: {
height: 350,
renderTo: 'container',
type: 'column',
marginRight: 130,
lang: {
thousandsSep: ','
},
marginBottom: 25,
// 3D initialization, comment out for non-3D columns
options3d: {
enabled: true,
alpha: 0,
beta: 2,
depth: 50,
viewDistance: 25
}
},
// main chart title (TOP)
title: {
style: {
fontWeight: 'bold'
},
text: 'Spender Industry',
x: -20 //center
},
// main chart sub-title (TOP)
subtitle: {
style: {
fontWeight: 'bold'
},
text: 'Totals',
x: -20
},
// xAxis title
xAxis: {
reversed: false,
title: {
text: 'Party'
},
labels: {
height: 200,
style: {
lineHeight: '14px',
fontWeight: 'bold',
staggerLines: 1
}
}
},
// yAxis title
yAxis: {
title: {
text: 'Dollar Amount',
style: {
fontWeight: 'bold'
}
},
// chart options for each plotted point
plotLines: [{
value: 1,
width: 1,
color: '#66837B'
}]
},
// tooltip on hover options
tooltip: {
lang: {
thousandsSep: ','
},
formatter: function() {
return '<b>'+ this.series.name +'</b><br/>'+
this.x +': '+ '$' + Highcharts.numberFormat(this.y, 0);
}
},
legend: {
layout: 'horizontal',
align: 'left',
verticalAlign: 'top',
x: 0,
y: 0,
borderWidth: 0,
},
plotOptions: {
bar: {
dataLabels: {
enabled: true,
distance: -100,
color: '#FFFFFF',
}
},
series: {
text: 'Total Dollar Amount',
color: '#66837B',
cursor: 'pointer',
connectNulls: true,
pointWidth: 70
},
column: {
stacking: 'normal',
dataLabels: {
enabled: true,
color: (Highcharts.theme && Highcharts.theme.dataLabelsColor) || '#000000',
formatter: function () {
return '$' + Highcharts.numberFormat(this.y,0);
}
},
lang: {
thousandsSep: ','
}
}
},
series: []

}
});

Here is an example (img) of the labels not showing and overflowing on the xAxis.

最佳答案

这是由这一行引起的:

 marginBottom: 25,

您有固定的底部边距 - 删除它,或者只是增加该值。

关于jquery - 如何使用 Highcharts 更改整个 xAxis 标签的高度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33618103/

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