Split out directives for Grouped and Stacked bars (though stacked is a fake for now). Ensure that multiple charts on the page can share the same datasource, by making a deep copy before manipulating data in the directive. An alternative would be to move the data formatting logic into the angular controller or the external resource, but this way it's easier for someone to reuse the directives with a simple data api.