g.js — graphical objects for JavaScript

accumulateaccumulate

Generate in between totals of a list of numbers.

g.accumulate([21, 14, 13, 3, 21]);

This is useful when rendering stacked visualizations, like calculating the starting angles for a pie chart (using the arc node.html).

Parameters

  • values: The list of values.