highcharts 向y轴行号添加填充

k2fxgqgv  于 2022-11-10  发布在  Highcharts
关注(0)|答案(1)|浏览(168)

https://jsfiddle.net/nye5g9s3/
我有下面的图表,有几个y轴,我不想为他们的标题。它看起来不好,因为y轴之间的数字行之间的填充丢失我该如何修复它?我该如何添加填充,和边距?

chart.addAxis({ // Secondary yAxis
        id: 'rainfall-axis',
        title: {
            text: ''
        },
        lineWidth: 2,
        lineColor: '#08F',
        opposite: true,
          labelsFormat: {
            primaryColor: '#F33',
            secondaryColor: '#F33',
            x: 1,
            y: 1,
            align: 'left',
          },
    });
idfiyjo8

idfiyjo81#

您可以透过marginlabels.x性质控制间距:

chart.addAxis({ // Secondary yAxis
    ...,
    margin: 5,
    labels: {
        x: 0
    }
  });

现场演示:https://jsfiddle.net/BlackLabel/wcdfjqsb/
API参考:

https://api.highcharts.com/highcharts/yAxis.labels.x
https://api.highcharts.com/highcharts/yAxis.margin

相关问题