如何在Y轴堆栈上添加顶部/底部边距标签-RecatJs高图

时间:2020-09-30 01:50:03

标签: javascript reactjs react-highcharts

我想在x轴的2个标签之间添加边距。这是我目前拥有的:

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类,并在其中提供边距。仍然没有运气。知道如何进行这项工作吗?

http://jsfiddle.net/7sgdbezh/

0 个答案:

没有答案