easy_pie_chart 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e85403fe202b0ab3ef67532e73a4d3ec86613b89
|
4
|
+
data.tar.gz: 98d460cafdf89a836af78be26bb89ccdc2786d11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90f8784513ff051d0916dcbda2b02b37fed16bb58cfece91acb49e364c8dbc280f2b98ebe48850009cf5653fa3ab8a11844b51e87ab5349f1a97e1db801d71db
|
7
|
+
data.tar.gz: 844abae362b7d6e8963cd8df1b4135820c84e2f3046b7672a60551b35580d71cab99363994d4140a76c5921c81c9cb3f2c3c2652e512cabb6ca424e5e904bfb7
|
data/easy_pie_chart.gemspec
CHANGED
@@ -9,15 +9,15 @@
|
|
9
9
|
|
10
10
|
(function(root, factory) {
|
11
11
|
if(typeof exports === 'object') {
|
12
|
-
module.exports = factory();
|
12
|
+
module.exports = factory(require('jquery'));
|
13
13
|
}
|
14
14
|
else if(typeof define === 'function' && define.amd) {
|
15
|
-
define([], factory);
|
15
|
+
define(['jquery'], factory);
|
16
16
|
}
|
17
17
|
else {
|
18
|
-
|
18
|
+
factory(root.jQuery);
|
19
19
|
}
|
20
|
-
}(this, function() {
|
20
|
+
}(this, function($) {
|
21
21
|
|
22
22
|
/**
|
23
23
|
* Renderer to render the chart on a canvas object
|
@@ -345,7 +345,16 @@ var EasyPieChart = function(el, opts) {
|
|
345
345
|
init();
|
346
346
|
};
|
347
347
|
|
348
|
+
$.fn.easyPieChart = function(options) {
|
349
|
+
return this.each(function() {
|
350
|
+
var instanceOptions;
|
351
|
+
|
352
|
+
if (!$.data(this, 'easyPieChart')) {
|
353
|
+
instanceOptions = $.extend({}, options, $(this).data());
|
354
|
+
$.data(this, 'easyPieChart', new EasyPieChart(this, instanceOptions));
|
355
|
+
}
|
356
|
+
});
|
357
|
+
};
|
348
358
|
|
349
|
-
return EasyPieChart;
|
350
359
|
|
351
|
-
}));
|
360
|
+
}));
|
@@ -9,13 +9,13 @@ Lightweight plugin to render simple, animated and retina optimized pie charts
|
|
9
9
|
###
|
10
10
|
((root, factory) ->
|
11
11
|
if typeof exports is "object"
|
12
|
-
module.exports = factory()
|
12
|
+
module.exports = factory(require("jquery"))
|
13
13
|
else if typeof define is "function" and define.amd
|
14
|
-
define [], factory
|
14
|
+
define ["jquery"], factory
|
15
15
|
else
|
16
|
-
root
|
16
|
+
factory root.jQuery
|
17
17
|
return
|
18
|
-
) this, ->
|
18
|
+
) this, ($) ->
|
19
19
|
|
20
20
|
###*
|
21
21
|
Renderer to render the chart on a canvas object
|
@@ -313,4 +313,13 @@ Lightweight plugin to render simple, animated and retina optimized pie charts
|
|
313
313
|
init()
|
314
314
|
return
|
315
315
|
|
316
|
-
|
316
|
+
$.fn.easyPieChart = (options) ->
|
317
|
+
@each ->
|
318
|
+
instanceOptions = undefined
|
319
|
+
unless $.data(this, "easyPieChart")
|
320
|
+
instanceOptions = $.extend({}, options, $(this).data())
|
321
|
+
$.data this, "easyPieChart", new EasyPieChart(this, instanceOptions)
|
322
|
+
return
|
323
|
+
|
324
|
+
|
325
|
+
return
|