Highcharts -外部文本索引标签

Highcharts - outside text index label

本文关键字:索引 标签 文本 外部 Highcharts      更新时间:2023-09-26

我有这个图表http://www.highcharts.com/demo/column-rotated-labels。如何将索引标签中的文本放在列外?谢谢你!

我相信你在问如何将标签从列内移动到外部,正确吗?

不幸的是,这些列内的值不是索引标签,而是数据标签。它们表示列的值。我通过将x属性修改为高图的"dataLabels"部分来移动它们。你可以在这里查看我是怎么做的:

http://jsfiddle.net/cpnq5fou/

 dataLabels: {
            enabled: true,
            rotation: -90,
            color: '#FFFFFF',
            align: 'right',
            format: '{point.y:.1f}', // one decimal
            y: 10, // 10 pixels down from the top
            x: 12, //12 pixels to move it to the right of the column, instead of inside
            style: {
                fontSize: '13px',
                fontFamily: 'Verdana, sans-serif'
            }