 'use strict'
 app = angular.module 'mean.transparency'
 
-app.directive 'tpaTimeline', ($rootScope) ->
+app.directive 'tpaTimeline', ($rootScope, $window) ->
      restrict: 'EA'
      scope:
           data: '='

                         d.value)
                    .staggerLabels(true)
                    .margin(margin)

                    chart.yAxis.tickFormat (d) -> d.toLocaleString $scope.getCurrentLanguage(), {style:"currency",currency:"EUR"}


                    .datum(data)
                    .call(chart);

                    angular.element($window).bind('resize', () ->
                         updateDiagram()
                         scope.$digest())

                    #nv.utils.windowResize(updateDiagram)
                    if $scope.events and $scope.events.length > 0
                         drawEvents($scope.events)
                    chart

          $scope.$watch 'data', updateDiagram, true
