在 Highcharts 的条形图中,全局数据可以通过 "series" 属性设置。然后可以在 "plotOptions" 中的 "series" 属性中获取到这些全局数据。

下面是一个示例:

Highcharts.chart('container', {
    series: [{
        data: [1, 3, 2, 4, 5]
    }],
    plotOptions: {
        series: {
            pointWidth: 20, // 设置每个数据点的宽度
            dataLabels: {
                enabled: true
            }
        }
    }
});

在上面的示例中,"series" 属性设置了一个数据数组,包含了全局数据。然后在 "plotOptions" 中的 "series" 属性中可以通过 "pointWidth" 属性来获取到全局数据并设置每个数据点的宽度。

注意:在 "plotOptions" 中的 "series" 属性中可以设置一些全局属性,这些属性会应用到所有的数据系列中。如果要设置特定数据系列的属性,可以在 "series" 数组中的每个数据系列对象中设置。

Highcharts 条形图:在 plotOptions 中访问全局数据

原文地址: https://www.cveoy.top/t/topic/p21z 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录