Encapsulate time series chart rendering into an angular.js directive