gpt4 book ai didi

javascript - Highchart - 如何在堆叠条上设置 minWidth?

转载 作者:行者123 更新时间:2023-11-28 04:05:38 26 4
gpt4 key购买 nike

我在尝试在 div 中呈现 Highchart 时遇到问题。我不知道为什么有些条显示不正确。

我在容器 Highcharts div 上设置了一个宽度值,期望条形图占据 div 的 100%,但如您所见,它并没有发生。

这是我如何设置 Highchart 选项:

var chart =  new Highcharts.Chart({
chart: {
type: 'bar',
spacingBottom: 1,
spacingTop: 1,
spacingRight: 1,
backgroundColor: null,
renderTo: containerId
},
colors: ['#8b878a', '#10914E', '#DBD311', '#7e8b00'],
title: '',
tooltip: {
enabled: false
},
xAxis: {
labels:{
enabled: false
}
},
yAxis: {
labels:{
enabled: false
},
gridLineWidth:0,
title: {
enabled: false
},
visibility: false
},
legend: {
enabled: false
},
plotOptions: {
series: {
stacking: 'normal',
dataLabels: {
enabled: true,
formatter: function() {
if(this.series.options.showPercentageValue && this.series.options.percentageValue > minValueBarPercentage){
return (Math.round(this.series.options.percentageValue) + ' %'); //~~(elimina decimales)
}
},
style:{fontSize: '9px', color:'black', paddingBottom: '1px', fontWeight: 'bold'}
},
pointPadding: 0,
groupPadding: 0.1
}
},
series: values
});

有什么想法吗?

最佳答案

这是正在发生的事情的图片>>> http://imgur.com/a/FEfpz

关于javascript - Highchart - 如何在堆叠条上设置 minWidth?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42980920/

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