highcharts极地图添加最大刻度线

时间:2018-02-15 01:15:50

标签: highcharts

如果你看一下这个code,你会看到我有:

tickPositions: [0, 1, 2, 3, 4, 5]

但只有0到4的刻度出现。我如何得到最大值?" 5"现身? 我可以隐藏" 0",而不会弄乱图表吗?

1 个答案:

答案 0 :(得分:1)

检查yAxis.showLastLabelyAxis.labels.formatter

您必须将yAxis更新为

yAxis: {
  min: 0,
  tickPositions: [0, 1, 2, 3, 4, 5],
  showLastLabel: true, //displays last label
  labels: {
    y: 15,    //displays labels below ring
    formatter: function() {
      console.log(this.value)
      var value = this.axis.defaultLabelFormatter.call(this);
      return (this.value === 0 ? ' ' : value);  //hides 0 value
    }
  }
},

fiddle演示

相关问题