Highcharts - 长xlabel内容会导致图表上出现巨大的空白区域

时间:2014-12-18 18:23:19

标签: javascript highcharts offset labels

请查看this fiddle (long labels)。 x轴有opposite:true

xAxis: {
    categories: ['0', '1', '2', '3'],
    min: 0,
    max: 1,
    alternateGridColor: 'gray',
    opposite: true,
    labels: {
        formatter: function () {
            return 'very very very very very very very very very very very veryvery very very very very very very veryvery very very very very veryvery very very very very veryvery very very very very veryvery very very very very very very long.';
        },
        style: {
            'background-color': 'red'
        },
        useHTML: true
    }
}

为什么Highcharts会将大标签垂直重叠?关于如何制作标签的任何想法看起来都要高一些?

To describe what I mean, here comes a screenshot

编辑:

重新构建了我的问题并添加了另一个小提琴+屏幕截图。谢谢你的回答。 :)

1 个答案:

答案 0 :(得分:0)

这是由您设置的y参数引起的。因此,当您的标签很短时,有位置(您定义的-50px),因此会打印间隙。