Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/382.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何将页边距上/下添加到Y轴堆叠标签-RecatJs highcharts_Javascript_Reactjs_React Highcharts - Fatal编程技术网

Javascript 如何将页边距上/下添加到Y轴堆叠标签-RecatJs highcharts

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',

我想在xaxis上的两个标签之间添加边距。这就是我目前拥有的:

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类并在其中提供边距,。还是不走运。你知道怎么做吗