Highchart气泡图:将Y轴值显示为数字范围

时间:2018-09-10 11:47:55

标签: highcharts range bubble-chart yaxis

我有一个Bubble Highchart,需要显示Y轴价格值作为“ 1-10”,“ 11-20”,“ 21-30”之类的价格范围。

但我无法达到同样的目的。

我该如何实现?

您好ppotaczek,非常感谢您的快速回复。我正在尝试通过以下屏幕截图实现气泡图。

Please refer this screen-shot

谢谢

1 个答案:

答案 0 :(得分:0)

您可以简单地使用formatter函数:

yAxis: {
  labels: {
    tickInterval: 25,
    formatter: function() {
      if (this.value > 0) {
        return this.value - 24 + ' - ' + (this.value);
      }
      return this.value;
    }
  },
}

实时演示:https://jsfiddle.net/BlackLabel/3rqdn5pj/

API参考:

https://api.highcharts.com/highcharts/yAxis.tickInterval

https://api.highcharts.com/highcharts/yAxis.labels.formatter

相关问题