且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在Highcharts.js中将数据标签添加到面积图

更新时间:2023-02-05 14:24:40

对于数据中的相关点,使用对象符号和启用的数据标签。您可以使用 格式 格式化程序 显示所需的信息。

For the relevant point in your data use the object notation and enabled data labels. You can use format and formatter to display the desired information.

您的系列示例如下:

series: [{
    name: 'My series name',
    data: [5, 10, 30, 100, 200, 300, 600,
        { 
            y: 900, 
            dataLabels: {
               enabled: true,
               format: '{series.name}'
            }
        },
        700, 400, 100]
}]

或参阅这个更详细的JSFiddle示例