Skip to content

Commit

Permalink
Take the first element into account when calculating sums, close #1597
Browse files Browse the repository at this point in the history
  • Loading branch information
slawekkolodziej committed Mar 22, 2013
1 parent 5d3048a commit ff67616
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
9 changes: 5 additions & 4 deletions js/highcharts-more.src.js
Expand Up @@ -1519,10 +1519,10 @@ seriesTypes.waterfall = extendClass(seriesTypes.column, {
points,
point,
shapeArgs,
sum = 0,
sumStart = 0,
subSum = 0,
subSumStart = 0,
sum,
sumStart,
subSum,
subSumStart,
edges,
cumulative,
prevStack,
Expand All @@ -1538,6 +1538,7 @@ seriesTypes.waterfall = extendClass(seriesTypes.column, {

points = this.points;
subSumStart = sumStart = points[0];
sum = subSum = points[0].y;

for (i = 1, len = points.length; i < len; i++) {
// cache current point object
Expand Down
9 changes: 5 additions & 4 deletions js/parts-more/WaterfallSeries.js
Expand Up @@ -137,10 +137,10 @@ seriesTypes.waterfall = extendClass(seriesTypes.column, {
points,
point,
shapeArgs,
sum = 0,
sumStart = 0,
subSum = 0,
subSumStart = 0,
sum,
sumStart,
subSum,
subSumStart,
edges,
cumulative,
prevStack,
Expand All @@ -156,6 +156,7 @@ seriesTypes.waterfall = extendClass(seriesTypes.column, {

points = this.points;
subSumStart = sumStart = points[0];
sum = subSum = points[0].y;

for (i = 1, len = points.length; i < len; i++) {
// cache current point object
Expand Down

0 comments on commit ff67616

Please sign in to comment.