系列中的子弹图不显示在y值之后

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

设置yAx的y值后,条形的其余部分不会出现。例如。在代码中我将y值设置为20但在20之后没有任何内容。所以我要做的是将所有线延伸到最大值并保持20。

截图

Screen Shoot

Highcharts.chart("container1", {
  chart: {
    marginTop: 40
  },
  title: {
    text: "Gauge Bar Chart"
  },
  xAxis: {
    categories: [
      '<span class="hc-cat-title">Revenue</span><br/>U.S. $ (1,000s)'
    ]
  },
  yAxis: {
    plotBands: [
      {
        from: 0,
        to: 1400,
        color: "#ffffff"
      }
    ],
    labels: {
      format: "{value}%"
    },
    title: null,
    max: 100,
    visible: true
  },

  series: [
    {
      animation: false,
      data: [
        {
          y: 20,
          target: 40
        }
      ]
    }
  ],

https://jsfiddle.net/mrtcnkrks/df1zbL9m/

我的目标有背景,直到100%hereScreen Shoot

javascript highcharts bullet-chart
1个回答
0
投票

您可以将plotBands添加到所有xAxis,例如:

xAxis: {
    ...,
    plotBands: [{
        from: -0.18,
        to: 0.15,
        color: "gray"
    }]
},

现场演示:https://jsfiddle.net/BlackLabel/oea97zhd/

API参考:https://api.highcharts.com/highcharts/yAxis.plotBands

© www.soinside.com 2019 - 2024. All rights reserved.