最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Highcharts Legend Overlaps with X-Axis - Stack Overflow

programmeradmin1浏览0评论

I'm setting up a chart where the legend is located below the line graph. For some reason, the legend seems to overlap with the x-axis above it. My settings for the legend are as follows:

 legend: {
            layout: 'horizontal',
            align: 'center',
            itemWidth: LegendWidth,
            verticalAlign: 'bottom',
            floating: true,
            margin: 25,
            borderWidth: 3,
            useHTML:true,
       }

Where LegendWidth is dynamically set. I've already added a value for margin but it still overlaps.

I'm setting up a chart where the legend is located below the line graph. For some reason, the legend seems to overlap with the x-axis above it. My settings for the legend are as follows:

 legend: {
            layout: 'horizontal',
            align: 'center',
            itemWidth: LegendWidth,
            verticalAlign: 'bottom',
            floating: true,
            margin: 25,
            borderWidth: 3,
            useHTML:true,
       }

Where LegendWidth is dynamically set. I've already added a value for margin but it still overlaps.

Share Improve this question asked Apr 24, 2015 at 1:20 EllesaEllesa 1551 silver badge6 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 7

You should set the legend.y to some positive number to move it further down.

legend: {
            layout: 'horizontal',
            align: 'center',
            itemWidth: LegendWidth,
            verticalAlign: 'bottom',
            floating: true,
            margin: 25,
            borderWidth: 3,
            useHTML:true,
            y : 25 /* pushes the legend 25 points down */
       }

Here is the doc, and here is a sample

发布评论

评论列表(0)

  1. 暂无评论