Skip to content

Commit 5d32c73

Browse files
author
scarroll
committed
Updates based on PR #1
Linechart suffered from bad copy pasta. Thanks @jclemans Updated the concatenated and minified files. Bumped version.
1 parent c3dfc0a commit 5d32c73

File tree

7 files changed

+22
-14
lines changed

7 files changed

+22
-14
lines changed

angular-graphael.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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
};

angular-graphael.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-graphael",
3-
"version": "0.0.1",
3+
"version": "0.1.0",
44
"description": "A set of AngularJS directives to make charts using gRaphaël.",
55
"homepage": "https://github.com/scottux/angular-graphael",
66
"authors": [

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-graphael",
3-
"version": "0.0.1",
3+
"version": "0.1.0",
44
"description": "A set of AngularJS directives to make charts using gRaphaël.",
55
"private": true,
66
"devDependencies": {

src/directives/barchartDirective.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ angular.module('angular-graphael').directive('barchart', function ($window, mapD
3030
y = scope.y || 100,
3131
// Width
3232
width = scope.width || 100,
33-
// height
33+
// Height
3434
height = scope.height || 100;
3535

3636
// If you don't remove the old chart, you're gonna have a bad time.

src/directives/dotchartDirective.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,13 @@ angular.module('angular-graphael').directive('dotchart', function ($window, mapD
2424
// Right now we only care about watching if the data changes.
2525
scope.$watch('size', function () {
2626
var r,
27+
// X coordinate
2728
x = scope.x || 0,
29+
// Y coordinate
2830
y = scope.y || 0,
31+
// Width
2932
width = scope.width || 500,
33+
// Height
3034
height = scope.height || 80;
3135

3236
// If you don't remove the old chart, you're gonna have a bad time.

src/directives/linechartDirective.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ angular.module('angular-graphael').directive('linechart', function ($window, map
3131
y = scope.y || 100,
3232
// Width
3333
width = scope.width || 100,
34-
// height
34+
// Height
3535
height = scope.height || 100;
3636

3737
// If you don't remove the old chart, you're gonna have a bad time.
3838
element[0].innerHTML = '';
3939
// Set up the canvas
4040
r = $window.Raphael(element[0]);
4141
// Add the chart to the canvas with all of our options and data.
42-
r.barchart(x, y, width, height, mapData(scope.valuesX), mapData(scope.valuesY), scope.options);
42+
r.linechart(x, y, width, height, mapData(scope.valuesX), mapData(scope.valuesY), scope.options);
4343
});
4444
}
4545
};

0 commit comments

Comments
 (0)