Hi Uma — Plotting negative values in bar graphs can be tricky!
The stacked bar will end at the sum of the values, in the positive direction.
When the data have a negative followed by a positive number, DataGraph stacks the bars in order, such that bars are drawn down and then up again. This is also happening in the case of the two bars but it may not be as obvious.
Here is an example to illustrate. Here is the data:
If it is graphed using a Bars command, it will look like this.
Note that I made the blue and the grey at 50% opacity so you can see through them.
Here is the stacked version, with arrows are added to illustrate the stacking of the negative and positive values.
Notice how the graph preserves the total. The value of the bar in the positive direction is the same as the total of each (A = 3, C = 4). The bar at ‘C’ is green in the negative because the yellow and blue are ‘combined’ due to the transparency of the blue.
To have the negative and positive values stacked separately, an Expression column can be used to create a column of each.
The positive and negative values plotted using separate Bars commands.
The caution here is that the values may look inflated. For example, column C looks like it has a value of 8, but the total is 4.
Hopefully this explains what you are seeing and how to create the separately stacked option, if that is what you prefer.