开发者

stacked waterfall charts in highcharts

开发者 https://www.devze.com 2023-03-03 09:58 出处:网络
We have a requirement for stacked waterfall cha开发者_如何学JAVArts (we are using highcharts.com).

We have a requirement for stacked waterfall cha开发者_如何学JAVArts (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'
        }
    }
});


http://highcharts.com/demo/column-stacked

0

精彩评论

暂无评论...
验证码 换一张
取 消