javascript Highcharts - 图表外的图例定位

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29510063/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-28 10:39:00  来源:igfitidea点击:

Highcharts - Legend Positioning outside the chart

javascripthighchartslegendlegend-properties

提问by ramya

Consider I have highchart like this highchart with legend inside

考虑一下我有像这个highchart这样的highchart 里面有图例

I want legend outside the chart. Please help.

我想要图表外的图例。请帮忙。

NOTE: I want my legend properties to be the same.

注意:我希望我的图例属性相同。

legend{
    layout: 'vertical',
    align: 'right',
    verticalAlign: 'middle'
}

However I want them outside the chart. Please help.

但是我希望它们在图表之外。请帮忙。

回答by Asgu

it seems like you need to set 'floating: false' http://jsfiddle.net/hx86zhob/1/

似乎您需要设置“浮动:假” http://jsfiddle.net/hx86zhob/1/

legend{
    layout: 'vertical',
    align: 'right',
    verticalAlign: 'middle',
    floating: false
}

回答by fabio_biondi

Have you tried something like this?

你有没有尝试过这样的事情?

"legend": {
 "align": "left",
  y: -20 // <=== use a negative value 
}