【问题标题】:Highcharts - Bar chart show full label on Y AxisHighcharts - 条形图在 Y 轴上显示完整标签
【发布时间】:2018-04-12 10:05:52
【问题描述】:

我在 y 轴的标签上使用格式来显示标签,如 100,000 与图表上自动设置的 100k 格式。

但是,这会将所有标签与每个标签末尾的“...”一起压缩 - 而不是显示完整值。

是否可以显示完整的标签(即 100,000)而不在末尾添加“...”?

我创建了一个 jfiddle,其中包含我所看到的示例 (https://jsfiddle.net/htjb6wxb/5/)

yAxis: [{
labels: {
        format: '{value:,.0f} ',
        rotation: 0,
        y: 20,
        overflow: 'justify',
        padding: '5 px',
        align: 'center',
        style: {
            color: 'black',
            fontSize: '5 px',
            fontWeight: 'normal',
        }
    },
    }],

感谢任何帮助。

【问题讨论】:

    标签: highcharts labels yaxis


    【解决方案1】:

    让您的标签不被切断的一种方法是在labels 中设置rotation 并将marginRight 添加到chart

    chart: {
            type: 'bar',
            marginRight: 50,
        },
    

     labels: {
                format: '{value:,.0f} ',
                rotation: -30,
                y: 20,
                overflow: 'justify',
                padding: '5 px',
                align: 'center',
                style: {
                    color: 'black',
                    fontSize: '5 px',
                    fontWeight: 'normal',
                }
            },
            }],
    

    Updated JSFiddle

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-03
      • 1970-01-01
      • 1970-01-01
      • 2018-07-24
      • 1970-01-01
      • 2013-06-21
      相关资源
      最近更新 更多