简体   繁体   中英

Highcharts JS - Sankey Diagram Axis

I am implementing a Sankey Diagram using Highcharts JS and have a problem with specifying the axis. Is it even possible to use xAxis and yAxis on a Sankey diagram?

I tried specifying the axis as following:

 yAxis: {
            title: {
                text: 'Test',
            }
        },
 xAxis: {
            title: {
                text: 'Test'
            }
        },

but with no success. I tried putting the aforementioned code in series , plotOptions.sankey , plotOptions.series and simply when instantiating the chart but with no result.

Looking forward to your help!

Yes. Use chart.showAxes option:

  chart: {
    showAxes: true
  },

Unfortunately in sankey series ticks are not generated for the y axis. It can be done manually like this:

  yAxis: [{
    lineWidth: 1,
    tickPositions: [0, 1, 2, 3]
  }],

Live demo: http://jsfiddle.net/BlackLabel/z5p9gba2/

API references:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM