javascript - Highcharts - 长的多行 y 轴标签导致以下标签被删除

标签 javascript html highcharts

我需要在 highcharts 条形图的 y 轴上添加一些非常长的多行标签。

我的问题是长的多行标签导致以下标签被删除 - 可能是某种内部重叠故障保护。

我正处于增加标签宽度的地步,以便我可以用换行符控制自己的换行(内部换行也会产生与丢失标签相同的问题。)

我希望能够关闭此功能并自己处理重叠。

例子: enter image description here

图表选项:

{
    "colors": [
        "#00AEEF"
    ],
    "credits": {
        "enabled": false
    },
    "chart": {
        "type": "bar"
    },
    "tooltip": {},
    "plotOptions": {
        "column": {
            "pointPadding": 0.2,
            "borderWidth": 0
        },
        "series": {
            "borderWidth": 0,
            "dataLabels": {
                "enabled": true,
                "format": "{point.y:.1f}%"
            }
        }
    },
    "series": [
        {
            "showInLegend": false,
            "data": [
                [
                    "this is a pretty long label <br/>that will most likely cause the next<br/> row not to appear",
                    70
                ],
                [
                    "this is a pretty long label <br/>that will most likely cause the next<br/> row not to appear",
                    62.5
                ],
                [
                    "this is a pretty long label <br/>that will most likely cause the next<br/> row not to appear",
                    41.25
                ],
                [
                    "this is a pretty long label <br/>that will most likely cause the next<br/> row not to appear",
                    26.25
                ],
                [
                    "this is a pretty long label <br/>that will most likely cause the next<br/> row not to appear",
                    18.75
                ],
                [
                    "this is a pretty long label <br/>that will most likely cause the next<br/> row not to appear",
                    11.25
                ],
                [
                    "this is a pretty long label <br/>that will most likely cause the next<br/> row not to appear",
                    7.5
                ],
                [
                    "this is a pretty long label <br/>that will most likely cause the next<br/> row not to appear",
                    3.75
                ],
                [
                    "this is a pretty long label <br/>that will most likely cause the next<br/> row not to appear",
                    3.75
                ]
            ]
        }
    ],
    "xAxis": {
        "minorGridLineWidth": 0,
        "minorTickLength": 0,
        "tickLength": 0,
        "type": "category",
        "labels": {
            "overflow": "justify",
            "style": {
                "color": "#525151",
                "fontSize": "12px",
                "lineHeight": "10%",
                "fontFamily": "Helvetica Neue, Helvetica ,Helvetica,Arial,sans-serif",
                "width": "999px"
            },
            "y": -10
        }
    },
    "yAxis": {
        "min": 0,
        "title": {
            "text": "Percent (%)"
        }
    }
} 

最佳答案

只需设置step: 1,参见:http://jsfiddle.net/Yrygy/135/

Docs .

关于javascript - Highcharts - 长的多行 y 轴标签导致以下标签被删除,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23584574/

相关文章:

javascript - 王牌编辑器 : Add custom keywords to Markdown mode

javascript - jQuery 表单提交未被调用

javascript - 如何让我的按钮在单击后发生变化以执行不同的功能?

javascript - 在类名末尾添加一个整数

javascript - MathJaX 的 CSS?

javascript - 简单的 for 循环似乎无法正常工作

javascript - AngularJS 指令添加其他不起作用的指令

Highcharts - 线图标记渲染不可靠?

javascript - 窗口最大化时 Highcharts 大小错误

javascript - 是否可以在 highcharts/highstock 中定位缩放按钮?