简体   繁体   English

Highcharts固定标签长度,防止调整图表大小

[英]Highcharts fixed label length, prevent chart from being resized

Hi i wonder if it's possible to disable the automatic scaling of a highchart. 嗨,我想知道是否有可能禁用highchart的自动缩放。

Or is ist possible to set a fixed position and or width and height to the labels ? 或者是否可以为标签设置固定位置和/或宽度和高度?

Here is an example, this is how i'd like to have my chart look like. 这是一个示例,这就是我希望图表显示的方式。 http://jsfiddle.net/ynXgw/6/ http://jsfiddle.net/ynXgw/6/

But if the labels have a different length highchart shrinks the graph. 但是,如果标签的长度不同,highchart将缩小图形。 http://jsfiddle.net/ynXgw/7/ http://jsfiddle.net/ynXgw/7/

Has anybody an idea how i could fix this? 有谁知道我该如何解决?

One way to solve your problem is to use a different series to display the labels. 解决问题的一种方法是使用其他系列显示标签。 In this example I use a second scatter series to display the labels. 在此示例中,我使用第二个散点图系列来显示标签。 To position the labels just set the y value. 要放置标签,只需设置y值。 I set the color of the points to the same color as the background to hide them. 我将点的颜色设置为与背景相同的颜色以隐藏它们。 Then I use the dataLabels formatter to display the labels how you want them. 然后,我使用dataLabels格式化程序以所需的方式显示标签。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM