Warm tip: This article is reproduced from stackoverflow.com, please click
highcharts

Is It possible to plot a water fall chart as shown in the below image?

发布于 2020-04-03 23:38:58

I need to plot a waterfall chart like below. In the chart, each column is a type of category and the value is calculated by adding the sub-types. How do we display the sub-types(ex: Gas 1, Gas 2) in the bottom and category(like Category 3) in the top. Is this possible in highcharts?

enter image description here

Questioner
Jomon
Viewed
61
ppotaczek 2020-01-31 20:12

You can use two xAxis with categories. For example:

xAxis: [{
  opposite: true,
  lineWidth: 0,
  categories: ['Start', 'Category1', 'Category2', 'Category3', 'Category4', 'Balance']
}, {
  linkedTo: 0,
  lineWidth: 0,
  categories: ['', 'Sub-Category 1', 'Liquid 1<br>Liquid 2', 'Gas 1<br>Gas 2', 'Solid 1', ''],
  labels: {
    rotation: 0,
    y: -10
  }
}]

Live demo: https://jsfiddle.net/BlackLabel/a9bzeqw4/1/

API Reference: https://api.highcharts.com/highcharts/xAxis.labels