2

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 !!

skaffman
  • 398,947
  • 96
  • 818
  • 769
toamitkumar
  • 39
  • 1
  • 5

3 Answers3

3

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/

David Beckwith
  • 2,679
  • 1
  • 17
  • 11
1

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'
        }
    }
});
NT3RP
  • 15,262
  • 9
  • 61
  • 97
  • This does not work. I had to modify the js code (highcarts.js) `pointStack.cum = yBottom = pointStack.cum - yValue;`` to `pointStack.cum = pointStack.cum - yValue;` Basically, the stacks ignore the `low` value in options. Another other ways of doing this ? – toamitkumar May 10 '11 at 04:11
  • short of editing highcharts as you have, I don't think it is possible to do what you have done. You should add your answer and mark it as accepted. – NT3RP May 10 '11 at 14:13
0

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

blackops
  • 2,205
  • 2
  • 18
  • 22
  • 1
    thats the normal column chart. I got it working. Look at https://github.com/toamitkumar/Stacked-Waterfall/tree/master/stacked-waterfall – toamitkumar Sep 13 '11 at 04:17