score:1

For those who interested in solution with adding additional data points with null here is it. This is the only way I found so far. Pay attention to the line with 'data', 'floor, 'ceiling', 'categories'. But I still think it's a hack and should be build in feature to do so.

// IMPORTANT! Pay attention that fake null data points added
// in order to display targets line correctly, so index 0 = null
config.series[0] = {
  cursor: this.props.onDataPointClick ? 'pointer' : undefined,
  type: 'column',
  data: [null, ...chartData, null],
  pointPadding: 0.01, // to make column full width
  groupPadding: 0, // to make column full width
  dataLabels: {
    enabled: true,
    align: 'center',
    inside: true,
    verticalAlign: 'bottom',
    formatter: function() {
      return humanReadableValue(this.y);
    }
  },
  point: {
    events: {
      click: (e) => this.onDataPointClick(e)
    }
  }
};
Object.assign(config.xAxis, {
  floor: 1,
  ceiling: config.series[0].data.length - 2,
  categories: config.series[0].data.map(x => x === null ? '' : x.name)
});

The result

enter image description here


Related Query

More Query from same tag