HighCharts:钟形曲线 - 如何添加偏差百分比区域

问题描述 投票:0回答:1

这是一个简单的“钟形曲线”图表:jsfiddle

    series: [{
    name: 'Bell curve',
    type: 'bellcurve',
    xAxis: 1,
    yAxis: 1,
    baseSeries: 1,
    zIndex: -1
}, {
    name: 'Data',
    type: 'scatter',
    data: data,
    accessibility: {
        exposeAsGroupOnly: true
    },
    marker: {
        radius: 1.5
    }
}]

enter image description here

问题:如何使用 HighCharts 突出显示偏差区域(百分比:2.35%、13.5%、34%)?

示例: enter image description here

highcharts
1个回答
0
投票

可以通过使用区域功能并将

series.zoneAxis
设置为“x”来完成。

API参考: https://api.highcharts.com/highcharts/series.bellcurve.zones

演示: https://jsfiddle.net/BlackLabel/3tjku69r/

  zoneAxis: "x",
  zones: [
    {
      value: 2.18,
      color: "rgb(255, 0, 0, 0.25)",
    },
    {
      value: 2.62,
      color: "rgb(0, 102, 255, 0.25)",
    },
    {
      value: 3.49,
      color: "rgb(51, 204, 51, 0.25)",
    },
    {
      value: 3.92,
      color: "rgb(0, 102, 255, 0.25)",
    },
    {
      color: "rgb(255, 0, 0, 0.25)",
    }
  ]
© www.soinside.com 2019 - 2024. All rights reserved.