Javascript 如何将页边距上/下添加到Y轴堆叠标签-RecatJs highcharts
我想在xaxis上的两个标签之间添加边距。这就是我目前拥有的:Javascript 如何将页边距上/下添加到Y轴堆叠标签-RecatJs highcharts,javascript,reactjs,react-highcharts,Javascript,Reactjs,React Highcharts,我想在xaxis上的两个标签之间添加边距。这就是我目前拥有的: yAxis: { allowDecimals: false, min: 0, title: { text: 'Number of fruits' }, stackLabels: { enabled: true, verticalAlign: 'bottom', crop: false, overflow: 'none',
yAxis: {
allowDecimals: false,
min: 0,
title: {
text: 'Number of fruits'
},
stackLabels: {
enabled: true,
verticalAlign: 'bottom',
crop: false,
overflow: 'none',
y: 20,
formatter: function() {
return this.stack;
},
style: {
fontSize: '9px',
marginTop: "2px"
}
}
},
但是,当我尝试为标签添加边距时,如:
stackLabels: {
enabled: true,
verticalAlign: 'bottom',
crop: false,
overflow: 'none',
y: 20,
formatter: function() {
return this.stack;
},
style: {
fontSize: '9px',
marginTop: "2px"
}
}
这是行不通的。我尝试在格式化程序中添加css类并在其中提供边距,。还是不走运。你知道怎么做吗