在高图图表上插入最后一个标签

时间:2017-10-25 01:09:13

标签: highcharts pie-chart gauge

我想将最后一个标签显示为此饼图的最大值。在这个例子中,我希望它将825000显示为最后一个标签。有没有办法做到这一点?

    "yAxis": [{
  "lineWidth": 0,
  "min": 0,
  "max": 825000, /* Budget + Contingency */
  tickColor: 'white',
  tickWidth: 4,
  minorTickInterval: 'auto',
  minorTickLength: 3,
  minorTickPosition: 'inside',
  tickPixelInterval: 50,
  tickPosition: '',
  tickLength: 30,
  showLastLabel: false,

https://jsfiddle.net/ahilans/2znc19n6/

1 个答案:

答案 0 :(得分:0)

您可以使用yAxis.tickPositioner获取所需的标签,但会转换为k千位

yAxis

"yAxis": [{
  "lineWidth": 0,
  "min": 0,
  "max": 825000, /* Budget + Contingency */
  tickColor: 'white',
  tickWidth: 4,
  minorTickInterval: 'auto',
  minorTickLength: 3,
  minorTickPosition: 'inside',
  tickPixelInterval: 50,
  tickPosition: '',
  tickLength: 30,
  showLastLabel: true,
  tickPositions: [0, 100000, 200000, 300000,400000,500000,600000,700000 ,825000],

  "labels": {
    "enabled": true,
    distance: 16,
    style: {
      color: '#50a2a7',
      font: '11px Trebuchet MS, Verdana, sans-serif'
    }
  },
  "title": {
    "text": "",
    "useHTML": false,
    "y": 80
  },
  "pane": 0
}],

Fiddle演示