topfunky/gruff — pull request #104 by AndrewClarke (2014-04-14 05:16:45+00:00)
Title: Accumulator mods

I've also made two changes to Accumulator bar

1/ the ability to set the label string for the accululator

This one is a no-brainer - it just required a defaulted attribute and an attr_accessor.

2/ the ability to set a non-zero starting point for the accumulator series.

The way I've organised it, it is possible to either quietly start with a non-zero accumulator, or draw attention to it with it's own label and colour.

Firstly, the carry_forward= accessor allows the carry-forward value to be set. This value is used as a seed for for running summation across the data series.

Secondly, IF the carry_forward_label= accessor is used to provide a string, then a distinct data set is added to the graph. Most of the values of this data set are set to zero except the first item which has the carry_forward value. The carry-forward value is also subtracted from the first entry of the accumulator series. Then the carry-forward series is pushed into the graph - it will pick it's own colour and show the label in the legend.