简体   繁体   中英

stacked waterfall charts in highcharts

We have a requirement for stacked waterfall charts (we are using highcharts.com). http://fiddle.jshell.net/8JP8T/ gives an option for creating waterfall charts but we need to create stacks. Anyone has done this before? Thanks !!

You can make stacked bars "levitate" by making an ghost series, then setting the ghost series to have an opacity of 0.

$.each(chart.series[2].data, function(i, point) {
  if (i==2) {
    point.graphic.attr({opacity: 0, 'stroke-width': 0});
  }
}

This fiddle illustrates the basic idea. Note that you need to turn shadows off and set showInLegend to false too to get the full ghostly effect.

http://jsfiddle.net/6UPrg/13/

Based in your example, you may be interested in the stacking property found within highcharts.

var chart = new Highcharts.Chart({
    //other properties...
    plotOptions: {
        series: {
            stacking: 'normal'
        }
    }
});

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