gionkunz/chartist-js — pull request #81 by drewbarontini (2014-11-10 22:41:09+00:00)
Title: Created Event

## What is this?

This adds a new event called `created`, which is triggered once a chart is finished drawing. This is created for all three charts, and it returns:

- The type (e.g. `Chartist.Bar`)
- The labels (in the case of `Chartist.Pie`, `seriesGroup`)
- The created SVG element

## Example usage

```javascript
var chart = new Chartist.Line('.ct-chart', {
labels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'],
series: [
[12, 9, 7, 8, 5],
[2, 1, 3.5, 7, 3],
[1, 3, 4, 5, 6]
]
});

chart.on('created', function(data) {
// ...
});
```

## Related issue

[Refs #80]

@gionkunz - I might need your helping sorting out what data to pass back from the event. Currently, I just send the `type`, `labels`, and `svg`, but the `Chartist.Pie` doesn't have the same `labels`, so I pass back `seriesGroup`. Let me know what you think!