@@ -46,7 +46,7 @@ angular.module('angular-graphael').directive('barchart', ["$window", "mapData",
46
46
y = scope . y || 100 ,
47
47
// Width
48
48
width = scope . width || 100 ,
49
- // height
49
+ // Height
50
50
height = scope . height || 100 ;
51
51
52
52
// 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",
74
74
return {
75
75
restrict : 'E' ,
76
76
scope : {
77
- valuesx : '=' ,
78
- valuesy : '=' ,
77
+ valuesX : '=' ,
78
+ valuesY : '=' ,
79
79
size : '=' ,
80
80
options : '=' ,
81
81
x : '=' ,
@@ -86,17 +86,21 @@ angular.module('angular-graphael').directive('dotchart', ["$window", "mapData",
86
86
// Right now we only care about watching if the data changes.
87
87
scope . $watch ( 'size' , function ( ) {
88
88
var r ,
89
+ // X coordinate
89
90
x = scope . x || 0 ,
91
+ // Y coordinate
90
92
y = scope . y || 0 ,
93
+ // Width
91
94
width = scope . width || 500 ,
95
+ // Height
92
96
height = scope . height || 80 ;
93
97
94
98
// If you don't remove the old chart, you're gonna have a bad time.
95
99
element [ 0 ] . innerHTML = '' ;
96
100
// Set up the canvas
97
101
r = $window . Raphael ( element [ 0 ] ) ;
98
102
// 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 ) ;
100
104
} ) ;
101
105
}
102
106
} ;
@@ -121,8 +125,8 @@ angular.module('angular-graphael').directive('linechart', ["$window", "mapData",
121
125
x : '=' ,
122
126
y : '=' ,
123
127
options : '=' ,
124
- valuesx : '=' ,
125
- valuesy : '='
128
+ valuesX : '=' ,
129
+ valuesY : '='
126
130
} ,
127
131
template : '<div></div>' ,
128
132
link : function ( scope , element ) {
@@ -135,15 +139,15 @@ angular.module('angular-graphael').directive('linechart', ["$window", "mapData",
135
139
y = scope . y || 100 ,
136
140
// Width
137
141
width = scope . width || 100 ,
138
- // height
142
+ // Height
139
143
height = scope . height || 100 ;
140
144
141
145
// If you don't remove the old chart, you're gonna have a bad time.
142
146
element [ 0 ] . innerHTML = '' ;
143
147
// Set up the canvas
144
148
r = $window . Raphael ( element [ 0 ] ) ;
145
149
// 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 ) ;
147
151
} ) ;
148
152
}
149
153
} ;
0 commit comments