@@ -46,7 +46,7 @@ angular.module('angular-graphael').directive('barchart', ["$window", "mapData",
4646 y = scope . y || 100 ,
4747 // Width
4848 width = scope . width || 100 ,
49- // height
49+ // Height
5050 height = scope . height || 100 ;
5151
5252 // If you don't remove the old chart, you're gonna have a bad time.
@@ -74,8 +74,8 @@ angular.module('angular-graphael').directive('dotchart', ["$window", "mapData",
7474 return {
7575 restrict : 'E' ,
7676 scope : {
77- valuesx : '=' ,
78- valuesy : '=' ,
77+ valuesX : '=' ,
78+ valuesY : '=' ,
7979 size : '=' ,
8080 options : '=' ,
8181 x : '=' ,
@@ -86,17 +86,21 @@ angular.module('angular-graphael').directive('dotchart', ["$window", "mapData",
8686 // Right now we only care about watching if the data changes.
8787 scope . $watch ( 'size' , function ( ) {
8888 var r ,
89+ // X coordinate
8990 x = scope . x || 0 ,
91+ // Y coordinate
9092 y = scope . y || 0 ,
93+ // Width
9194 width = scope . width || 500 ,
95+ // Height
9296 height = scope . height || 80 ;
9397
9498 // If you don't remove the old chart, you're gonna have a bad time.
9599 element [ 0 ] . innerHTML = '' ;
96100 // Set up the canvas
97101 r = $window . Raphael ( element [ 0 ] ) ;
98102 // Add the chart to the canvas with all of our options and data.
99- r . dotchart ( x , y , width , height , scope . valuesx , scope . valuesy , mapData ( scope . size ) , scope . options ) ;
103+ r . dotchart ( x , y , width , height , scope . valuesX , scope . valuesY , mapData ( scope . size ) , scope . options ) ;
100104 } ) ;
101105 }
102106 } ;
@@ -121,8 +125,8 @@ angular.module('angular-graphael').directive('linechart', ["$window", "mapData",
121125 x : '=' ,
122126 y : '=' ,
123127 options : '=' ,
124- valuesx : '=' ,
125- valuesy : '='
128+ valuesX : '=' ,
129+ valuesY : '='
126130 } ,
127131 template : '<div></div>' ,
128132 link : function ( scope , element ) {
@@ -135,15 +139,15 @@ angular.module('angular-graphael').directive('linechart', ["$window", "mapData",
135139 y = scope . y || 100 ,
136140 // Width
137141 width = scope . width || 100 ,
138- // height
142+ // Height
139143 height = scope . height || 100 ;
140144
141145 // If you don't remove the old chart, you're gonna have a bad time.
142146 element [ 0 ] . innerHTML = '' ;
143147 // Set up the canvas
144148 r = $window . Raphael ( element [ 0 ] ) ;
145149 // Add the chart to the canvas with all of our options and data.
146- r . barchart ( x , y , width , height , mapData ( scope . valuesx ) , mapData ( scope . valuesy ) , scope . options ) ;
150+ r . linechart ( x , y , width , height , mapData ( scope . valuesX ) , mapData ( scope . valuesY ) , scope . options ) ;
147151 } ) ;
148152 }
149153 } ;
0 commit comments