Creating dynamic graphs using AngularJS