rgraph-rails 5.00 → 6.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/publish-geml.yaml +46 -0
- data/.gitignore +1 -0
- data/README.md +4 -5
- data/lib/rgraph-rails/version.rb +1 -1
- data/rgraph-rails.gemspec +4 -4
- data/vendor/assets/javascripts/RGraph.activity.js +1691 -0
- data/vendor/assets/javascripts/RGraph.bar.js +4253 -236
- data/vendor/assets/javascripts/RGraph.bipolar.js +3958 -162
- data/vendor/assets/javascripts/RGraph.common.annotate.js +414 -35
- data/vendor/assets/javascripts/RGraph.common.context.js +635 -30
- data/vendor/assets/javascripts/RGraph.common.core.js +10485 -419
- data/vendor/assets/javascripts/RGraph.common.csv.js +508 -27
- data/vendor/assets/javascripts/RGraph.common.dynamic.js +1693 -90
- data/vendor/assets/javascripts/RGraph.common.effects.js +1629 -89
- data/vendor/assets/javascripts/RGraph.common.key.js +1003 -53
- data/vendor/assets/javascripts/RGraph.common.moment.js +5670 -0
- data/vendor/assets/javascripts/RGraph.common.sheets.js +541 -31
- data/vendor/assets/javascripts/RGraph.common.sheets.php +351 -0
- data/vendor/assets/javascripts/RGraph.common.starburst.js +382 -0
- data/vendor/assets/javascripts/RGraph.common.table.js +386 -0
- data/vendor/assets/javascripts/RGraph.common.tooltips.js +1433 -32
- data/vendor/assets/javascripts/RGraph.drawing.background.js +660 -35
- data/vendor/assets/javascripts/RGraph.drawing.circle.js +618 -34
- data/vendor/assets/javascripts/RGraph.drawing.image.js +857 -52
- data/vendor/assets/javascripts/RGraph.drawing.line.js +712 -0
- data/vendor/assets/javascripts/RGraph.drawing.marker1.js +760 -38
- data/vendor/assets/javascripts/RGraph.drawing.marker2.js +740 -37
- data/vendor/assets/javascripts/RGraph.drawing.marker3.js +573 -36
- data/vendor/assets/javascripts/RGraph.drawing.poly.js +667 -36
- data/vendor/assets/javascripts/RGraph.drawing.rect.js +638 -34
- data/vendor/assets/javascripts/RGraph.drawing.text.js +672 -37
- data/vendor/assets/javascripts/RGraph.drawing.xaxis.js +653 -52
- data/vendor/assets/javascripts/RGraph.drawing.yaxis.js +714 -51
- data/vendor/assets/javascripts/RGraph.fuel.js +1149 -59
- data/vendor/assets/javascripts/RGraph.funnel.js +1277 -56
- data/vendor/assets/javascripts/RGraph.gantt.js +1646 -82
- data/vendor/assets/javascripts/RGraph.gauge.js +1773 -89
- data/vendor/assets/javascripts/RGraph.hbar.js +3869 -159
- data/vendor/assets/javascripts/RGraph.horseshoe.js +970 -0
- data/vendor/assets/javascripts/RGraph.hprogress.js +1829 -81
- data/vendor/assets/javascripts/RGraph.line.js +5293 -244
- data/vendor/assets/javascripts/RGraph.meter.js +1570 -77
- data/vendor/assets/javascripts/RGraph.modaldialog.js +300 -19
- data/vendor/assets/javascripts/RGraph.odo.js +1553 -68
- data/vendor/assets/javascripts/RGraph.pie.js +3273 -129
- data/vendor/assets/javascripts/RGraph.radar.js +2333 -108
- data/vendor/assets/javascripts/RGraph.rose.js +2685 -114
- data/vendor/assets/javascripts/RGraph.rscatter.js +1920 -80
- data/vendor/assets/javascripts/RGraph.scatter.js +4215 -171
- data/vendor/assets/javascripts/RGraph.segmented.js +1006 -0
- data/vendor/assets/javascripts/RGraph.semicircularprogress.js +1980 -59
- data/vendor/assets/javascripts/RGraph.svg.activity.js +1696 -0
- data/vendor/assets/javascripts/RGraph.svg.bar.js +2575 -77
- data/vendor/assets/javascripts/RGraph.svg.bipolar.js +3533 -106
- data/vendor/assets/javascripts/RGraph.svg.common.ajax.js +240 -21
- data/vendor/assets/javascripts/RGraph.svg.common.core.js +7105 -299
- data/vendor/assets/javascripts/RGraph.svg.common.csv.js +408 -28
- data/vendor/assets/javascripts/RGraph.svg.common.fx.js +1291 -68
- data/vendor/assets/javascripts/RGraph.svg.common.key.js +451 -20
- data/vendor/assets/javascripts/RGraph.svg.common.sheets.js +543 -31
- data/vendor/assets/javascripts/RGraph.svg.common.table.js +391 -0
- data/vendor/assets/javascripts/RGraph.svg.common.tooltips.js +1072 -23
- data/vendor/assets/javascripts/RGraph.svg.funnel.js +1151 -32
- data/vendor/assets/javascripts/RGraph.svg.gauge.js +1429 -34
- data/vendor/assets/javascripts/RGraph.svg.hbar.js +2692 -65
- data/vendor/assets/javascripts/RGraph.svg.horseshoe.js +969 -0
- data/vendor/assets/javascripts/RGraph.svg.line.js +2855 -86
- data/vendor/assets/javascripts/RGraph.svg.pie.js +1630 -58
- data/vendor/assets/javascripts/RGraph.svg.radar.js +1772 -58
- data/vendor/assets/javascripts/RGraph.svg.rose.js +2419 -83
- data/vendor/assets/javascripts/RGraph.svg.scatter.js +2280 -65
- data/vendor/assets/javascripts/RGraph.svg.segmented.js +930 -0
- data/vendor/assets/javascripts/RGraph.svg.semicircularprogress.js +1612 -29
- data/vendor/assets/javascripts/RGraph.svg.waterfall.js +1525 -50
- data/vendor/assets/javascripts/RGraph.thermometer.js +1411 -64
- data/vendor/assets/javascripts/RGraph.vprogress.js +1915 -81
- data/vendor/assets/javascripts/RGraph.waterfall.js +1896 -89
- data/vendor/assets/javascripts/financial-data.js +1067 -0
- metadata +37 -16
- data/.travis.yml +0 -11
- data/vendor/assets/javascripts/RGraph.common.deprecated.js +0 -35
- data/vendor/assets/javascripts/RGraph.common.resizing.js +0 -38
- data/vendor/assets/javascripts/RGraph.common.zoom.js +0 -15
- data/vendor/assets/javascripts/RGraph.cornergauge.js +0 -71
@@ -1,69 +1,1292 @@
|
|
1
|
+
'version:2023-09-16 (6.14)';
|
2
|
+
//
|
3
|
+
// o--------------------------------------------------------------------------------o
|
4
|
+
// | This file is part of the RGraph package - you can learn more at: |
|
5
|
+
// | |
|
6
|
+
// | https://www.rgraph.net |
|
7
|
+
// | |
|
8
|
+
// | RGraph is licensed under the Open Source MIT license. That means that it's |
|
9
|
+
// | totally free to use and there are no restrictions on what you can do with it! |
|
10
|
+
// o--------------------------------------------------------------------------------o
|
1
11
|
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
{
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
{
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
{
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
{
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
{
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
12
|
+
//
|
13
|
+
// This is a library of a few functions that make it easier to do
|
14
|
+
// effects like fade-ins or eaxpansion.
|
15
|
+
//
|
16
|
+
|
17
|
+
//
|
18
|
+
// Initialise the various objects
|
19
|
+
//
|
20
|
+
RGraph = window.RGraph || {isrgraph:true,isRGraph:true,rgraph:true};
|
21
|
+
RGraph.SVG = RGraph.SVG || {};
|
22
|
+
RGraph.SVG.FX = RGraph.SVG.FX || {};
|
23
|
+
|
24
|
+
// Module pattern
|
25
|
+
(function (win, doc, undefined)
|
26
|
+
{
|
27
|
+
//
|
28
|
+
// This functions adds the generic effects to thechart object
|
29
|
+
//
|
30
|
+
// @param object obj The chart object
|
31
|
+
//
|
32
|
+
RGraph.SVG.FX.decorate = function (obj)
|
33
|
+
{
|
34
|
+
for (i in RGraph.SVG.FX) {
|
35
|
+
if (typeof RGraph.SVG.FX[i] === 'function') {
|
36
|
+
obj[i] = RGraph.SVG.FX[i];
|
37
|
+
}
|
38
|
+
}
|
39
|
+
};
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
//
|
49
|
+
// fadeIn
|
50
|
+
//
|
51
|
+
// This function simply uses the CSS opacity property - initially set to zero and
|
52
|
+
// increasing to 1 over the period of 0.5 second
|
53
|
+
//
|
54
|
+
RGraph.SVG.FX.fadein = function ()
|
55
|
+
{
|
56
|
+
// This function gets added to the chart object - so the this
|
57
|
+
// variable is the chart object
|
58
|
+
var obj = this,
|
59
|
+
opt = arguments[0] || {},
|
60
|
+
frames = opt.frames || 90,
|
61
|
+
duration = (frames / 60) * 1000,
|
62
|
+
frame = 0,
|
63
|
+
callback = opt.callback || function () {};
|
64
|
+
|
65
|
+
|
66
|
+
// Initially the opacity should be zero
|
67
|
+
obj.svg.style.opacity = 0;
|
68
|
+
|
69
|
+
// Draw the chart
|
70
|
+
RGraph.SVG.redraw(this.svg);
|
71
|
+
|
72
|
+
// Now fade the chart in
|
73
|
+
for (var i=1; i<=frames; ++i) {
|
74
|
+
(function (index)
|
75
|
+
{
|
76
|
+
setTimeout(function ()
|
77
|
+
{
|
78
|
+
obj.svg.style.opacity = (index / frames);
|
79
|
+
|
80
|
+
if (index >= frames) {
|
81
|
+
callback(obj);
|
82
|
+
}
|
83
|
+
|
84
|
+
}, (index / frames) * duration);
|
85
|
+
})(i)
|
86
|
+
}
|
87
|
+
|
88
|
+
|
89
|
+
return this;
|
90
|
+
};
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
//
|
100
|
+
// fadeOut
|
101
|
+
//
|
102
|
+
// This function is a reversal of the above function - fading out instead of in
|
103
|
+
//
|
104
|
+
RGraph.SVG.FX.fadeout = function ()
|
105
|
+
{
|
106
|
+
// This function gets added to the chart object - so the this
|
107
|
+
// variable is the chart object
|
108
|
+
var obj = this,
|
109
|
+
opt = arguments[0] || {},
|
110
|
+
frames = opt.frames || 90,
|
111
|
+
duration = (frames / 60) * 1000,
|
112
|
+
frame = 0,
|
113
|
+
callback = opt.callback || function () {};
|
114
|
+
|
115
|
+
//RGraph.SVG.redraw()
|
116
|
+
|
117
|
+
// Now fade the chart out
|
118
|
+
for (var i=1; i<=frames; ++i) {
|
119
|
+
(function (index)
|
120
|
+
{
|
121
|
+
setTimeout(function ()
|
122
|
+
{
|
123
|
+
obj.svg.style.opacity = 1 - (index / frames);
|
124
|
+
|
125
|
+
if (index >= frames) {
|
126
|
+
callback(obj);
|
127
|
+
}
|
128
|
+
}, (index / frames) * duration);
|
129
|
+
})(i)
|
130
|
+
}
|
131
|
+
|
132
|
+
return this;
|
133
|
+
};
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
//
|
143
|
+
// fadeSlideIn
|
144
|
+
//
|
145
|
+
// This function fades the canvas in in a sliding motion
|
146
|
+
//
|
147
|
+
RGraph.SVG.FX.fadeslidein = function ()
|
148
|
+
{
|
149
|
+
// This function gets added to the chart object - so the this
|
150
|
+
// variable is the chart object
|
151
|
+
var obj = this,
|
152
|
+
opt = arguments[0] || {},
|
153
|
+
frames = opt.frames || 90,
|
154
|
+
frame = 0,
|
155
|
+
pc = -20,
|
156
|
+
step = (120 - pc) / frames,
|
157
|
+
color = opt.color || 'white',
|
158
|
+
width = this.container.offsetWidth,
|
159
|
+
height = this.container.offsetHeight,
|
160
|
+
callback = opt.callback || function () {};
|
161
|
+
|
162
|
+
|
163
|
+
// Draw the chart
|
164
|
+
RGraph.SVG.redraw(this.svg);
|
165
|
+
|
166
|
+
|
167
|
+
// Create the cover
|
168
|
+
jQuery('<div id="rgraph_fadeslide_cover_' + obj.id + '"></div>').css({
|
169
|
+
background: 'linear-gradient(135deg, rgba(255,255,255,0) ' + pc + '%, ' + color + ' ' + (pc + 20) + '%)',
|
170
|
+
width: width + 'px',
|
171
|
+
height: height + 'px',
|
172
|
+
top: 0,
|
173
|
+
left: 0,
|
174
|
+
position: 'absolute'
|
175
|
+
}).appendTo(jQuery(this.container));
|
176
|
+
|
177
|
+
|
178
|
+
function iterator ()
|
179
|
+
{
|
180
|
+
if (pc < 120) {
|
181
|
+
jQuery('div#rgraph_fadeslide_cover_' + obj.id).css({
|
182
|
+
background: 'linear-gradient(135deg, rgba(255,255,255,0) ' + pc + '%, ' + color + ' ' + (pc + 20) + '%)'
|
183
|
+
});
|
184
|
+
pc += step;
|
185
|
+
RGraph.SVG.FX.update(iterator);
|
186
|
+
|
187
|
+
} else {
|
188
|
+
|
189
|
+
jQuery('div#rgraph_fadeslide_cover_' + obj.id).remove();
|
190
|
+
|
191
|
+
callback(obj);
|
192
|
+
}
|
193
|
+
}
|
194
|
+
|
195
|
+
iterator();
|
196
|
+
|
197
|
+
return this;
|
198
|
+
};
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
//
|
207
|
+
// fadeSlideOut
|
208
|
+
//
|
209
|
+
// Fades the canvas out in a sliding motion. This function gets added
|
210
|
+
// to the chart object - so the this variable is the chart object
|
211
|
+
//
|
212
|
+
RGraph.SVG.FX.fadeslideout = function ()
|
213
|
+
{
|
214
|
+
var obj = this,
|
215
|
+
opt = arguments[0] || {},
|
216
|
+
frames = opt.frames || 90,
|
217
|
+
frame = 0,
|
218
|
+
pc = -20,
|
219
|
+
step = (120 - pc) / frames,
|
220
|
+
canvasXY = RGraph.SVG.getSVGXY(obj.svg),
|
221
|
+
color = opt.color || 'white',
|
222
|
+
width = this.container.offsetWidth,
|
223
|
+
height = this.container.offsetHeight,
|
224
|
+
callback = opt.callback || function () {};
|
225
|
+
|
226
|
+
|
227
|
+
// Draw the chart
|
228
|
+
//RGraph.SVG.redraw(this.svg);
|
229
|
+
|
230
|
+
// Create the cover
|
231
|
+
jQuery('<div id="rgraph_fadeslide_cover_' + obj.id + '"></div>').css({
|
232
|
+
background: 'linear-gradient(135deg, ' + color + ' ' + pc + '%, rgba(255,255,255,0) ' + (pc + 20) + '%)',
|
233
|
+
width: width + 'px',
|
234
|
+
height: height + 'px',
|
235
|
+
top: 0,
|
236
|
+
left: 0,
|
237
|
+
position: 'absolute'
|
238
|
+
}).appendTo(jQuery(obj.svg.parentNode));
|
239
|
+
|
240
|
+
function iterator ()
|
241
|
+
{
|
242
|
+
if (pc < 120) {
|
243
|
+
jQuery('div#rgraph_fadeslide_cover_' + obj.id).css({
|
244
|
+
background: 'linear-gradient(135deg, ' + color + ' ' + pc + '%, rgba(255,255,255,0) ' + (pc + 20) + '%)'
|
245
|
+
});
|
246
|
+
pc += step;
|
247
|
+
RGraph.SVG.FX.update(iterator);
|
248
|
+
|
249
|
+
} else {
|
250
|
+
|
251
|
+
RGraph.SVG.clear(obj.svg);
|
252
|
+
|
253
|
+
jQuery('div#rgraph_fadeslide_cover_' + obj.id).remove();
|
254
|
+
|
255
|
+
callback(obj);
|
256
|
+
}
|
257
|
+
}
|
258
|
+
|
259
|
+
iterator();
|
260
|
+
|
261
|
+
return this;
|
262
|
+
};
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
//
|
272
|
+
// fadeCircularIn
|
273
|
+
//
|
274
|
+
// This function uses radial CSS gradients to cover the canvas with a radial fade in effect
|
275
|
+
// (from the center outwards)
|
276
|
+
//
|
277
|
+
RGraph.SVG.FX.fadecircularinoutwards = function ()
|
278
|
+
{
|
279
|
+
// This function gets added to the chart object - so the 'this'
|
280
|
+
// variable is the chart object
|
281
|
+
var obj = this,
|
282
|
+
opt = arguments[0] || {},
|
283
|
+
frames = opt.frames || 90,
|
284
|
+
frame = 1,
|
285
|
+
radius = 0,
|
286
|
+
svgXY = RGraph.SVG.getSVGXY(obj.svg),
|
287
|
+
color = opt.color || 'white',
|
288
|
+
callback = opt.callback || function () {};
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
// Draw the chart
|
294
|
+
RGraph.SVG.redraw(this.svg);
|
295
|
+
|
296
|
+
|
297
|
+
|
298
|
+
// Create the cover
|
299
|
+
jQuery('<div id="rgraph_fadecircularinoutwards_cover_' + obj.id + '"></div>').css({
|
300
|
+
background: 'radial-gradient(rgba(255,255,255,0) 0%, ' + color + ' ' + radius + '%)',
|
301
|
+
width: this.container.offsetWidth + 'px',
|
302
|
+
height: this.container.offsetHeight + 'px',
|
303
|
+
top: 0,
|
304
|
+
left: 0,
|
305
|
+
position: 'absolute'
|
306
|
+
}).appendTo(jQuery(obj.svg.parentNode));
|
307
|
+
|
308
|
+
|
309
|
+
|
310
|
+
|
311
|
+
function iterator ()
|
312
|
+
{
|
313
|
+
if (frame < frames) {
|
314
|
+
|
315
|
+
jQuery('div#rgraph_fadecircularinoutwards_cover_' + obj.id).css({
|
316
|
+
background: 'radial-gradient(rgba(255,255,255,0) ' + ((frame++ / frames) * 100) + '%, ' + color + ' ' + ((frame++ / frames) * 150) + '%)'
|
317
|
+
});
|
318
|
+
|
319
|
+
RGraph.SVG.FX.update(iterator);
|
320
|
+
|
321
|
+
} else {
|
322
|
+
|
323
|
+
jQuery('div#rgraph_fadecircularinoutwards_cover_' + obj.id).remove();
|
324
|
+
|
325
|
+
callback(obj);
|
326
|
+
}
|
327
|
+
}
|
328
|
+
|
329
|
+
iterator();
|
330
|
+
|
331
|
+
return this;
|
332
|
+
};
|
333
|
+
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
|
340
|
+
|
341
|
+
//
|
342
|
+
// fadecircularoutoutwards
|
343
|
+
//
|
344
|
+
// This function uses radial CSS gradients to cover the canvas with a radial fade out effect
|
345
|
+
// (from the center outwards)
|
346
|
+
//
|
347
|
+
RGraph.SVG.FX.fadecircularoutoutwards = function ()
|
348
|
+
{
|
349
|
+
// This function gets added to the chart object - so the this
|
350
|
+
// variable is the chart object
|
351
|
+
var obj = this,
|
352
|
+
opt = arguments[0] || {},
|
353
|
+
frames = opt.frames || 90,
|
354
|
+
frame = 0,
|
355
|
+
width = this.container.offsetWidth,
|
356
|
+
height = this.container.offsetHeight,
|
357
|
+
canvasXY = RGraph.SVG.getSVGXY(obj.svg),
|
358
|
+
color = opt.color || 'white',
|
359
|
+
callback = opt.callback || function () {};
|
360
|
+
|
361
|
+
|
362
|
+
|
363
|
+
|
364
|
+
|
365
|
+
// Draw the chart
|
366
|
+
//RGraph.SVG.redraw(this.svg);
|
367
|
+
|
368
|
+
|
369
|
+
|
370
|
+
|
371
|
+
|
372
|
+
// Create the cover
|
373
|
+
jQuery('<div id="rgraph_fadeslide_cover_' + obj.id + '"></div>').css({
|
374
|
+
background: 'radial-gradient(rgba(255,255,255,0) 0%, transparent 0%)',
|
375
|
+
width: width + 'px',
|
376
|
+
height: height + 'px',
|
377
|
+
top: 0,
|
378
|
+
left: 0,
|
379
|
+
position: 'absolute'
|
380
|
+
}).appendTo(jQuery(obj.svg.parentNode));
|
381
|
+
|
382
|
+
|
383
|
+
|
384
|
+
|
385
|
+
function iterator ()
|
386
|
+
{
|
387
|
+
if (frame < frames) {
|
388
|
+
|
389
|
+
jQuery('div#rgraph_fadeslide_cover_' + obj.id).css({
|
390
|
+
background: 'radial-gradient(' + color + ' ' + ((frame++ / frames) * 100) + '%, rgba(255,255,255,0) ' + ((frame++ / frames) * 150) + '%)'
|
391
|
+
});
|
392
|
+
RGraph.SVG.FX.update(iterator);
|
393
|
+
|
394
|
+
} else {
|
395
|
+
|
396
|
+
RGraph.SVG.clear(obj.svg);
|
397
|
+
|
398
|
+
jQuery('div#rgraph_fadeslide_cover_' + obj.id).remove();
|
399
|
+
|
400
|
+
callback(obj);
|
401
|
+
}
|
402
|
+
}
|
403
|
+
|
404
|
+
iterator();
|
405
|
+
|
406
|
+
return this;
|
407
|
+
};
|
408
|
+
|
409
|
+
|
410
|
+
|
411
|
+
|
412
|
+
|
413
|
+
|
414
|
+
|
415
|
+
|
416
|
+
//
|
417
|
+
// fadeCircularInInwards
|
418
|
+
//
|
419
|
+
// This function gets added to the chart object - so the 'this'
|
420
|
+
// variable is the chart object
|
421
|
+
//
|
422
|
+
RGraph.SVG.FX.fadecircularininwards = function ()
|
423
|
+
{
|
424
|
+
var obj = this,
|
425
|
+
opt = arguments[0] || {},
|
426
|
+
frames = opt.frames || 90,
|
427
|
+
frame = 0,
|
428
|
+
radius = Math.max(
|
429
|
+
obj.container.offsetWidth,
|
430
|
+
obj.container.offsetHeight
|
431
|
+
),
|
432
|
+
color = opt.color || 'white',
|
433
|
+
callback = opt.callback || function () {};
|
434
|
+
|
435
|
+
|
436
|
+
// Draw the chart
|
437
|
+
RGraph.SVG.redraw(this.svg);
|
438
|
+
|
439
|
+
|
440
|
+
|
441
|
+
// Create the cover
|
442
|
+
jQuery('<div id="rgraph_fadeslide_cover_' + obj.id + '"></div>').css({
|
443
|
+
background: 'radial-gradient(rgba(255,255,255,0) 100%, rgba(255,255,255,0) 0%)',
|
444
|
+
width: this.container.offsetWidth + 'px',
|
445
|
+
height: this.container.offsetHeight + 'px',
|
446
|
+
top: 0,
|
447
|
+
left: 0,
|
448
|
+
position: 'absolute'
|
449
|
+
}).appendTo(jQuery(obj.svg.parentNode));
|
450
|
+
|
451
|
+
function iterator ()
|
452
|
+
{
|
453
|
+
if (frame < frames) {
|
454
|
+
|
455
|
+
jQuery('div#rgraph_fadeslide_cover_' + obj.id).css({
|
456
|
+
background: 'radial-gradient(' + color + ' ' + (( (frames - frame++) / frames) * 100) + '%, rgba(255,255,255,0) ' + (( (frames - frame++) / frames) * 120) + '%)'
|
457
|
+
});
|
458
|
+
RGraph.SVG.FX.update(iterator);
|
459
|
+
|
460
|
+
} else {
|
461
|
+
|
462
|
+
jQuery('div#rgraph_fadeslide_cover_' + obj.id).remove();
|
463
|
+
|
464
|
+
callback(obj);
|
465
|
+
}
|
466
|
+
}
|
467
|
+
|
468
|
+
iterator();
|
469
|
+
|
470
|
+
return this;
|
471
|
+
};
|
472
|
+
|
473
|
+
|
474
|
+
|
475
|
+
|
476
|
+
|
477
|
+
|
478
|
+
|
479
|
+
|
480
|
+
//
|
481
|
+
// fadecircularoutinwards
|
482
|
+
//
|
483
|
+
// This function gets added to the chart object - so the this
|
484
|
+
// variable is the chart object
|
485
|
+
//
|
486
|
+
RGraph.SVG.FX.fadecircularoutinwards = function ()
|
487
|
+
{
|
488
|
+
var obj = this,
|
489
|
+
opt = arguments[0] || {},
|
490
|
+
frames = opt.frames || 90,
|
491
|
+
frame = 0,
|
492
|
+
radius = Math.max(
|
493
|
+
this.container.offsetWidth,
|
494
|
+
this.container.offsetHeight
|
495
|
+
),
|
496
|
+
color = opt.color || 'white',
|
497
|
+
callback = opt.callback || function () {};
|
498
|
+
|
499
|
+
|
500
|
+
|
501
|
+
// Draw the chart
|
502
|
+
//RGraph.SVG.redraw(this.svg);
|
503
|
+
|
504
|
+
|
505
|
+
|
506
|
+
// Create the cover
|
507
|
+
jQuery('<div id="rgraph_fadeslide_cover_' + this.id + '"></div>').css({
|
508
|
+
background: 'radial-gradient(rgba(255,255,255,0) 0%, rgba(255,255,255,0) 0%)',
|
509
|
+
width: this.container.offsetWidth + 'px',
|
510
|
+
height: this.container.offsetHeight + 'px',
|
511
|
+
top: 0,
|
512
|
+
left: 0,
|
513
|
+
position: 'absolute'
|
514
|
+
}).appendTo(jQuery(obj.svg.parentNode));
|
515
|
+
|
516
|
+
function iterator ()
|
517
|
+
{
|
518
|
+
if (frame < frames) {
|
519
|
+
|
520
|
+
jQuery('div#rgraph_fadeslide_cover_' + obj.id).css({
|
521
|
+
background: 'radial-gradient(rgba(255,255,255,0) ' + (( (frames - frame++) / frames) * 100) + '%, ' + color + ' ' + (( (frames - frame++) / frames) * 120) + '%)'
|
522
|
+
});
|
523
|
+
|
524
|
+
RGraph.SVG.FX.update(iterator);
|
525
|
+
|
526
|
+
} else {
|
527
|
+
|
528
|
+
RGraph.SVG.clear(obj.svg);
|
529
|
+
|
530
|
+
jQuery('div#rgraph_fadeslide_cover_' + obj.id).remove();
|
531
|
+
|
532
|
+
callback(obj);
|
533
|
+
}
|
534
|
+
}
|
535
|
+
|
536
|
+
iterator();
|
537
|
+
|
538
|
+
return this;
|
539
|
+
};
|
540
|
+
|
541
|
+
|
542
|
+
|
543
|
+
|
544
|
+
//
|
545
|
+
// Reveal
|
546
|
+
//
|
547
|
+
// With this effect the chart is slowly revealed from the centre outwards. This
|
548
|
+
// function gets added to the chart object - so the 'this' variable is the chart
|
549
|
+
// object
|
550
|
+
//
|
551
|
+
// @param object Options for the effect. You can give frames here
|
552
|
+
// @param function An optional callback function
|
553
|
+
//
|
554
|
+
RGraph.SVG.FX.reveal = function ()
|
555
|
+
{
|
556
|
+
var obj = this,
|
557
|
+
opt = arguments[0] || {}
|
558
|
+
color = opt.color || 'white',
|
559
|
+
frames = opt.frames || 90,
|
560
|
+
duration = (frames / 60) * 1000,
|
561
|
+
callback = opt.callback || function () {}
|
562
|
+
|
563
|
+
var divs = [
|
564
|
+
['rgraph_reveal_left_' + this.id, 0, 0, this.container.offsetWidth / 2, this.container.offsetHeight],
|
565
|
+
['rgraph_reveal_right_' + this.id,(this.container.offsetWidth / 2),0,(this.container.offsetWidth / 2),this.container.offsetHeight],
|
566
|
+
['rgraph_reveal_top_' + this.id,0,0,this.container.offsetWidth,(this.container.offsetHeight / 2)],
|
567
|
+
['rgraph_reveal_bottom_' + this.id,0,(this.container.offsetHeight / 2),this.container.offsetWidth,(this.container.offsetHeight / 2)]
|
568
|
+
];
|
569
|
+
|
570
|
+
for (var i=0,len=divs.length; i<len; ++i) {
|
571
|
+
var div = doc.createElement('DIV');
|
572
|
+
div.id = divs[i][0];
|
573
|
+
div.style.left = divs[i][1] + 'px';
|
574
|
+
div.style.top = divs[i][2] + 'px';
|
575
|
+
div.style.width = divs[i][3] + 'px';
|
576
|
+
div.style.height = divs[i][4] + 'px';
|
577
|
+
div.style.position = 'absolute';
|
578
|
+
div.style.backgroundColor = color;
|
579
|
+
this.container.appendChild(div);
|
580
|
+
}
|
581
|
+
|
582
|
+
|
583
|
+
// Redraw
|
584
|
+
RGraph.SVG.redraw(obj.svg);
|
585
|
+
|
586
|
+
|
587
|
+
// Animate the shrinking of the DIVs
|
588
|
+
jQuery('#rgraph_reveal_left_' + obj.id).animate({width: 0}, duration);
|
589
|
+
jQuery('#rgraph_reveal_right_' + obj.id).animate({left: '+=' + (this.container.offsetWidth / 2),width: 0}, duration);
|
590
|
+
jQuery('#rgraph_reveal_top_' + obj.id).animate({height: 0}, duration);
|
591
|
+
jQuery('#rgraph_reveal_bottom_' + obj.id).animate({top: '+=' + (this.container.offsetHeight / 2),height: 0}, duration);
|
592
|
+
|
593
|
+
// Remove the DIVs from the DOM 100ms after the animation ends
|
594
|
+
setTimeout(function ()
|
595
|
+
{
|
596
|
+
obj.container.removeChild(doc.getElementById("rgraph_reveal_top_" + obj.id));
|
597
|
+
obj.container.removeChild(doc.getElementById("rgraph_reveal_bottom_" + obj.id));
|
598
|
+
obj.container.removeChild(doc.getElementById("rgraph_reveal_left_" + obj.id));
|
599
|
+
obj.container.removeChild(doc.getElementById("rgraph_reveal_right_" + obj.id));
|
600
|
+
|
601
|
+
callback(obj);
|
602
|
+
}, duration);
|
603
|
+
|
604
|
+
|
605
|
+
return this;
|
606
|
+
};
|
607
|
+
|
608
|
+
|
609
|
+
|
610
|
+
|
611
|
+
|
612
|
+
|
613
|
+
|
614
|
+
|
615
|
+
//
|
616
|
+
// Conceal
|
617
|
+
//
|
618
|
+
// This effect is the reverse of the Reveal effect - instead of revealing
|
619
|
+
// the canvas it conceals it. Combined with the reveal effect would make
|
620
|
+
// for a nice wipe effect.
|
621
|
+
//
|
622
|
+
// @param object obj The chart object
|
623
|
+
///
|
624
|
+
RGraph.SVG.FX.conceal = function ()
|
625
|
+
{
|
626
|
+
var obj = this,
|
627
|
+
opt = arguments[0] || {},
|
628
|
+
frames = opt.frames || 90,
|
629
|
+
callback = opt.callback || function () {},
|
630
|
+
color = opt.color || 'white',
|
631
|
+
duration = (frames / 60) * 1000,
|
632
|
+
frame = 0;
|
633
|
+
|
634
|
+
|
635
|
+
|
636
|
+
var divs = [
|
637
|
+
['rgraph_conceal_left_' + obj.id, 0, 0, 0, this.container.offsetHeight],
|
638
|
+
['rgraph_conceal_right_' + obj.id,this.container.offsetWidth,0,0,this.container.offsetHeight],
|
639
|
+
['rgraph_conceal_top_' + obj.id,0,0,this.container.offsetWidth,0],
|
640
|
+
['rgraph_conceal_bottom_' + obj.id,0,this.container.offsetHeight,this.container.offsetWidth,0]
|
641
|
+
];
|
642
|
+
|
643
|
+
|
644
|
+
|
645
|
+
|
646
|
+
for (var i=0,len=divs.length; i<len; ++i) {
|
647
|
+
var div = doc.createElement('DIV');
|
648
|
+
div.id = divs[i][0];
|
649
|
+
div.style.left = divs[i][1] + 'px';
|
650
|
+
div.style.top = divs[i][2] + 'px';
|
651
|
+
div.style.width = divs[i][3] + 'px';
|
652
|
+
div.style.height = divs[i][4] + 'px';
|
653
|
+
div.style.position = 'absolute';
|
654
|
+
div.style.backgroundColor = color;
|
655
|
+
this.container.appendChild(div);
|
656
|
+
}
|
657
|
+
|
658
|
+
jQuery('#rgraph_conceal_left_' + obj.id).animate({width: '+=' + (this.container.offsetWidth / 2)}, duration);
|
659
|
+
jQuery('#rgraph_conceal_right_' + obj.id).animate({left: '-=' + (this.container.offsetWidth / 2),width: (this.container.offsetWidth / 2)}, duration);
|
660
|
+
jQuery('#rgraph_conceal_top_' + obj.id).animate({height: '+=' + (this.container.offsetHeight / 2)}, duration);
|
661
|
+
jQuery('#rgraph_conceal_bottom_' + obj.id).animate({top: '-=' + (this.container.offsetHeight / 2),height: (this.container.offsetHeight / 2)}, duration);
|
662
|
+
|
663
|
+
// Remove the DIVs from the DOM 100ms after the animation ends
|
664
|
+
setTimeout(
|
665
|
+
function ()
|
666
|
+
{
|
667
|
+
obj.container.removeChild(doc.getElementById("rgraph_conceal_top_" + obj.id));
|
668
|
+
obj.container.removeChild(doc.getElementById("rgraph_conceal_bottom_" + obj.id));
|
669
|
+
obj.container.removeChild(doc.getElementById("rgraph_conceal_left_" + obj.id));
|
670
|
+
obj.container.removeChild(doc.getElementById("rgraph_conceal_right_" + obj.id));
|
671
|
+
|
672
|
+
RGraph.SVG.clear(obj.svg);
|
673
|
+
|
674
|
+
callback(obj);
|
675
|
+
|
676
|
+
},
|
677
|
+
duration
|
678
|
+
);
|
679
|
+
|
680
|
+
return this;
|
681
|
+
};
|
682
|
+
|
683
|
+
|
684
|
+
|
685
|
+
|
686
|
+
|
687
|
+
|
688
|
+
|
689
|
+
|
690
|
+
//
|
691
|
+
// Horizontal Blinds (open)
|
692
|
+
//
|
693
|
+
// @params object obj The graph object
|
694
|
+
//
|
695
|
+
RGraph.SVG.FX.hblindsopen = function ()
|
696
|
+
{
|
697
|
+
// This function gets added to the chart object - so the this
|
698
|
+
// variable is the chart object
|
699
|
+
var obj = this,
|
700
|
+
opt = arguments[0] || {},
|
701
|
+
frames = opt.frames || 90,
|
702
|
+
duration = (frames / 60) * 1000,
|
703
|
+
frame = 0,
|
704
|
+
callback = opt.callback || function () {},
|
705
|
+
color = opt.color || 'white',
|
706
|
+
height = this.container.offsetHeight / 5;
|
707
|
+
|
708
|
+
//
|
709
|
+
// First draw the chart
|
710
|
+
//
|
711
|
+
RGraph.SVG.redraw(this.svg);
|
712
|
+
|
713
|
+
for (var i=0; i<5; ++i) {
|
714
|
+
var div = doc.createElement('DIV');
|
715
|
+
div.id = 'rgraph_hblinds_' + i + '_' + obj.id;
|
716
|
+
div.style.left = 0;
|
717
|
+
div.style.top = ((this.container.offsetHeight * (i / 5))) + 'px';
|
718
|
+
div.style.width = this.container.offsetWidth + 'px';
|
719
|
+
div.style.height = (this.container.offsetHeight / 5) + 'px';
|
720
|
+
div.style.position = 'absolute';
|
721
|
+
div.style.backgroundColor = color;
|
722
|
+
this.container.appendChild(div);
|
723
|
+
|
724
|
+
jQuery('#rgraph_hblinds_' + i + '_' + obj.id).animate({height: 0}, duration);
|
725
|
+
}
|
726
|
+
|
727
|
+
setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_hblinds_0_' + obj.id));}, duration);
|
728
|
+
setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_hblinds_1_' + obj.id));}, duration);
|
729
|
+
setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_hblinds_2_' + obj.id));}, duration);
|
730
|
+
setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_hblinds_3_' + obj.id));}, duration);
|
731
|
+
setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_hblinds_4_' + obj.id));}, duration);
|
732
|
+
setTimeout(function () {callback(obj);}, duration);
|
733
|
+
|
734
|
+
return this;
|
735
|
+
};
|
736
|
+
|
737
|
+
|
738
|
+
|
739
|
+
|
740
|
+
|
741
|
+
|
742
|
+
|
743
|
+
|
744
|
+
//
|
745
|
+
// Horizontal Blinds (close)
|
746
|
+
//
|
747
|
+
// This function gets added to the chart object - so the this
|
748
|
+
// variable is the chart object
|
749
|
+
//
|
750
|
+
// @params object obj The graph object
|
751
|
+
//
|
752
|
+
RGraph.SVG.FX.hblindsclose = function ()
|
753
|
+
{
|
754
|
+
var obj = this,
|
755
|
+
opt = arguments[0] || {},
|
756
|
+
frames = opt.frames || 90,
|
757
|
+
duration = (frames / 60) * 1000,
|
758
|
+
frame = 0,
|
759
|
+
callback = opt.callback || function () {},
|
760
|
+
color = opt.color = 'white',
|
761
|
+
height = this.container.offsetHeight / 5;
|
762
|
+
|
763
|
+
|
764
|
+
|
765
|
+
for (var i=0; i<5; ++i) {
|
766
|
+
var div = doc.createElement('DIV');
|
767
|
+
div.id = 'rgraph_hblinds_' + i + '_' + obj.id;
|
768
|
+
div.style.left = 0;
|
769
|
+
div.style.top = (this.container.offsetHeight * (i / 5)) + 'px';
|
770
|
+
div.style.width = this.container.offsetWidth + 'px';
|
771
|
+
div.style.height = 0;
|
772
|
+
div.style.position = 'absolute';
|
773
|
+
div.style.backgroundColor = color;
|
774
|
+
this.container.appendChild(div);
|
775
|
+
|
776
|
+
jQuery('#rgraph_hblinds_' + i + '_' + obj.id)
|
777
|
+
.animate({
|
778
|
+
height: height + 'px'
|
779
|
+
}, duration);
|
780
|
+
}
|
781
|
+
|
782
|
+
|
783
|
+
|
784
|
+
setTimeout(function () {RGraph.SVG.clear(obj.svg);}, duration + 100);
|
785
|
+
setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_hblinds_0_' + obj.id));}, duration + 100);
|
786
|
+
setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_hblinds_1_' + obj.id));}, duration + 100);
|
787
|
+
setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_hblinds_2_' + obj.id));}, duration + 100);
|
788
|
+
setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_hblinds_3_' + obj.id));}, duration + 100);
|
789
|
+
setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_hblinds_4_' + obj.id));}, duration + 100);
|
790
|
+
setTimeout(function () {callback(obj);}, duration + 100);
|
791
|
+
};
|
792
|
+
|
793
|
+
|
794
|
+
|
795
|
+
|
796
|
+
|
797
|
+
|
798
|
+
|
799
|
+
|
800
|
+
//
|
801
|
+
// Vertical Blinds (open)
|
802
|
+
//
|
803
|
+
// @params object obj The graph object
|
804
|
+
//
|
805
|
+
// This function gets added to the chart object - so the this
|
806
|
+
// variable is the chart object
|
807
|
+
RGraph.SVG.FX.vblindsopen = function ()
|
808
|
+
{
|
809
|
+
var obj = this,
|
810
|
+
opt = arguments[0] || {},
|
811
|
+
frames = opt.frames || 90,
|
812
|
+
duration = (frames / 60) * 1000,
|
813
|
+
frame = 0,
|
814
|
+
callback = opt.callback || function () {},
|
815
|
+
color = opt.color || 'white',
|
816
|
+
width = this.container.offsetWidth / 10;
|
817
|
+
|
818
|
+
//
|
819
|
+
// First draw the chart
|
820
|
+
//
|
821
|
+
RGraph.SVG.redraw(obj.svg);
|
822
|
+
|
823
|
+
for (var i=0; i<10; ++i) {
|
824
|
+
var div = doc.createElement('DIV');
|
825
|
+
div.id = 'rgraph_vblinds_' + i + '_' + obj.id;
|
826
|
+
div.style.width = width + 'px';
|
827
|
+
div.style.height = this.container.offsetHeight + 'px';
|
828
|
+
div.style.left = (this.container.offsetWidth * (i / 10)) + 'px';
|
829
|
+
div.style.top = 0;
|
830
|
+
div.style.position = 'absolute';
|
831
|
+
div.style.backgroundColor = color;
|
832
|
+
obj.container.appendChild(div);
|
833
|
+
|
834
|
+
jQuery('#rgraph_vblinds_' + i + '_' + obj.id).animate({width: 0}, duration);
|
835
|
+
}
|
836
|
+
|
837
|
+
setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_vblinds_0_' + obj.id));}, duration + 100);
|
838
|
+
setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_vblinds_1_' + obj.id));}, duration + 100);
|
839
|
+
setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_vblinds_2_' + obj.id));}, duration + 100);
|
840
|
+
setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_vblinds_3_' + obj.id));}, duration + 100);
|
841
|
+
setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_vblinds_4_' + obj.id));}, duration + 100);
|
842
|
+
setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_vblinds_5_' + obj.id));}, duration + 100);
|
843
|
+
setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_vblinds_6_' + obj.id));}, duration + 100);
|
844
|
+
setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_vblinds_7_' + obj.id));}, duration + 100);
|
845
|
+
setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_vblinds_8_' + obj.id));}, duration + 100);
|
846
|
+
setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_vblinds_9_' + obj.id));}, duration + 100);
|
847
|
+
|
848
|
+
setTimeout(function () {callback(obj);}, duration + 100);
|
849
|
+
|
850
|
+
return this;
|
851
|
+
};
|
852
|
+
|
853
|
+
|
854
|
+
|
855
|
+
|
856
|
+
|
857
|
+
|
858
|
+
|
859
|
+
|
860
|
+
//
|
861
|
+
// Vertical Blinds (close)
|
862
|
+
//
|
863
|
+
// This function gets added to the chart object - so the this
|
864
|
+
// variable is the chart object
|
865
|
+
//
|
866
|
+
// @params object obj The graph object
|
867
|
+
//
|
868
|
+
RGraph.SVG.FX.vblindsclose = function ()
|
869
|
+
{
|
870
|
+
var obj = this,
|
871
|
+
opt = arguments[0] || {},
|
872
|
+
frames = opt.frames || 90,
|
873
|
+
duration = (frames / 60) * 1000,
|
874
|
+
frame = 0,
|
875
|
+
callback = opt.callback || function () {},
|
876
|
+
color = opt.color || 'white',
|
877
|
+
width = this.container.offsetWidth / 10;
|
878
|
+
|
879
|
+
// Create the blinds
|
880
|
+
for (var i=0; i<10; ++i) {
|
881
|
+
var div = doc.createElement('DIV');
|
882
|
+
div.id = 'rgraph_vblinds_' + i + '_' + obj.id;
|
883
|
+
div.style.left = (this.container.offsetWidth * (i / 10)) + 'px';
|
884
|
+
div.style.top = 0;
|
885
|
+
div.style.width = 0;
|
886
|
+
div.style.height = this.container.offsetHeight + 'px';
|
887
|
+
div.style.position = 'absolute';
|
888
|
+
div.style.backgroundColor = color;
|
889
|
+
this.container.appendChild(div);
|
890
|
+
|
891
|
+
jQuery('#rgraph_vblinds_' + i + '_' + obj.id).animate({width: width}, duration);
|
892
|
+
}
|
893
|
+
|
894
|
+
setTimeout(function () {RGraph.SVG.clear(obj.svg);}, duration + 100);
|
895
|
+
|
896
|
+
setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_vblinds_0_' + obj.id));}, duration + 100);
|
897
|
+
setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_vblinds_1_' + obj.id));}, duration + 100);
|
898
|
+
setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_vblinds_2_' + obj.id));}, duration + 100);
|
899
|
+
setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_vblinds_3_' + obj.id));}, duration + 100);
|
900
|
+
setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_vblinds_4_' + obj.id));}, duration + 100);
|
901
|
+
setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_vblinds_5_' + obj.id));}, duration + 100);
|
902
|
+
setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_vblinds_6_' + obj.id));}, duration + 100);
|
903
|
+
setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_vblinds_7_' + obj.id));}, duration + 100);
|
904
|
+
setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_vblinds_8_' + obj.id));}, duration + 100);
|
905
|
+
setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_vblinds_9_' + obj.id));}, duration + 100);
|
906
|
+
|
907
|
+
setTimeout(function () {callback(obj);}, duration + 100);
|
908
|
+
|
909
|
+
return this;
|
910
|
+
};
|
911
|
+
|
912
|
+
|
913
|
+
|
914
|
+
|
915
|
+
|
916
|
+
|
917
|
+
|
918
|
+
|
919
|
+
//
|
920
|
+
// Slide in
|
921
|
+
//
|
922
|
+
// This function is a wipe that can be used when switching the canvas to a
|
923
|
+
// new graph
|
924
|
+
//
|
925
|
+
// This function gets added to the chart object - so the this
|
926
|
+
// variable is the chart object
|
927
|
+
//
|
928
|
+
// @param object obj The graph object
|
929
|
+
//
|
930
|
+
RGraph.SVG.FX.slidein = function ()
|
931
|
+
{
|
932
|
+
var obj = this,
|
933
|
+
opt = arguments[0] || {},
|
934
|
+
frames = opt.frames || 90,
|
935
|
+
duration = (frames / 60) * 1000,
|
936
|
+
frame = 0,
|
937
|
+
callback = opt.callback || function () {},
|
938
|
+
color = opt.color || 'white',
|
939
|
+
width = this.container.offsetWidth / 10,
|
940
|
+
from = opt.from || 'left';
|
941
|
+
|
942
|
+
this.container.style.overflow = 'hidden';
|
943
|
+
|
944
|
+
RGraph.SVG.redraw(this.svg);
|
945
|
+
|
946
|
+
this.svg.style.position = 'relative';
|
947
|
+
|
948
|
+
if (from == 'left') {
|
949
|
+
this.svg.style.left = (0 - this.container.offsetWidth) + 'px';
|
950
|
+
this.svg.style.top = 0;
|
951
|
+
} else if (from == 'top') {
|
952
|
+
this.svg.style.left = 0;
|
953
|
+
this.svg.style.top = (0 - this.container.offsetHeight) + 'px';
|
954
|
+
} else if (from == 'bottom') {
|
955
|
+
this.svg.style.left = 0;
|
956
|
+
this.svg.style.top = this.container.offsetHeight + 'px';
|
957
|
+
} else {
|
958
|
+
this.svg.style.left = this.container.offsetWidth + 'px';
|
959
|
+
this.svg.style.top = 0;
|
960
|
+
}
|
961
|
+
|
962
|
+
jQuery(this.svg).animate({left:0,top:0}, duration, function ()
|
963
|
+
{
|
964
|
+
callback(obj);
|
965
|
+
});
|
966
|
+
|
967
|
+
return this;
|
968
|
+
};
|
969
|
+
|
970
|
+
|
971
|
+
|
972
|
+
|
973
|
+
|
974
|
+
|
975
|
+
|
976
|
+
|
977
|
+
//
|
978
|
+
// Slide out
|
979
|
+
//
|
980
|
+
// This function is a wipe that can be used when switching the canvas to a new graph
|
981
|
+
//
|
982
|
+
// @param object Optional object containing configuration.
|
983
|
+
// @param function Optional callback function
|
984
|
+
//
|
985
|
+
RGraph.SVG.FX.slideout = function ()
|
986
|
+
{
|
987
|
+
// This function gets added to the chart object - so the this
|
988
|
+
// variable is the chart object
|
989
|
+
var opt = arguments[0] || {},
|
990
|
+
frames = opt.frames || 90,
|
991
|
+
color = opt.color || 'white',
|
992
|
+
to = opt.to || 'left',
|
993
|
+
duration = (frames / 60) * 1000,
|
994
|
+
frame = 0,
|
995
|
+
callback = opt.callback || function () {},
|
996
|
+
width = this.container.offetsWidth / 10;
|
997
|
+
|
998
|
+
this.container.style.overflow= 'hidden';
|
999
|
+
|
1000
|
+
this.svg.style.position = 'relative';
|
1001
|
+
this.svg.style.left = 0;
|
1002
|
+
this.svg.style.top = 0;
|
1003
|
+
|
1004
|
+
if (to == 'left') {
|
1005
|
+
jQuery(this.svg).animate({left: (0 - this.container.offsetWidth) + 'px'}, duration, function () {callback(this);});
|
1006
|
+
} else if (to == 'top') {
|
1007
|
+
jQuery(this.svg).animate({left: 0, top: (0 - this.container.offsetHeight) + 'px'}, duration, function () {callback(this);});
|
1008
|
+
} else if (to == 'bottom') {
|
1009
|
+
jQuery(this.svg).animate({top: (0 + this.container.offsetHeight) + 'px'}, duration, function () {callback(this);});
|
1010
|
+
} else {
|
1011
|
+
jQuery(this.svg).animate({left: (0 + this.container.offsetWidth) + 'px'}, duration, function () {callback(this);});
|
1012
|
+
}
|
1013
|
+
|
1014
|
+
return this;
|
1015
|
+
};
|
1016
|
+
|
1017
|
+
|
1018
|
+
|
1019
|
+
|
1020
|
+
|
1021
|
+
|
1022
|
+
|
1023
|
+
|
1024
|
+
//
|
1025
|
+
// Horizontal Scissors (open)
|
1026
|
+
//
|
1027
|
+
// This function gets added to the chart object - so the this
|
1028
|
+
// variable is the chart object
|
1029
|
+
//
|
1030
|
+
// @param object Optional array of options
|
1031
|
+
// @param function Optional callback function
|
1032
|
+
//
|
1033
|
+
//
|
1034
|
+
RGraph.SVG.FX.hscissorsopen = function ()
|
1035
|
+
{
|
1036
|
+
var opt = arguments[0] || {},
|
1037
|
+
obj = this,
|
1038
|
+
frames = opt.frames || 90,
|
1039
|
+
callback = opt.callback || function () {},
|
1040
|
+
color = opt.color || 'white',
|
1041
|
+
to = opt.to || 'left',
|
1042
|
+
frame = 0,
|
1043
|
+
duration = (frames / 60) * 1000,
|
1044
|
+
width = this.container.offsetWidth / 10,
|
1045
|
+
height = this.container.offsetHeight / 5;
|
1046
|
+
|
1047
|
+
|
1048
|
+
//
|
1049
|
+
// First draw the chart
|
1050
|
+
//
|
1051
|
+
RGraph.SVG.redraw(this.svg);
|
1052
|
+
|
1053
|
+
|
1054
|
+
for (var i=0; i<5; ++i) {
|
1055
|
+
var div = doc.getElementById("rgraph_hscissors_" + i + '_' + this.id)
|
1056
|
+
if (!div) {
|
1057
|
+
var div = doc.createElement('DIV');
|
1058
|
+
div.id = 'rgraph_hscissors_' + i + '_' + this.id;
|
1059
|
+
div.style.width = this.container.offsetWidth + 'px';
|
1060
|
+
div.style.height = (this.container.offsetHeight / 5) + 'px';
|
1061
|
+
div.style.left = 0;
|
1062
|
+
div.style.top = (this.container.offsetHeight * (i / 5)) + 'px';
|
1063
|
+
div.style.position = 'absolute';
|
1064
|
+
div.style.backgroundColor = color;
|
1065
|
+
this.container.appendChild(div);
|
1066
|
+
}
|
1067
|
+
|
1068
|
+
if (i % 2 == 0) {
|
1069
|
+
jQuery('#' + 'rgraph_hscissors_' + i + '_' + this.id).animate({left: this.container.offsetWidth + 'px', width: 0}, duration);
|
1070
|
+
} else {
|
1071
|
+
jQuery('#' + 'rgraph_hscissors_' + i + '_' + this.id).animate({width: 0}, duration);
|
1072
|
+
}
|
1073
|
+
}
|
1074
|
+
|
1075
|
+
setTimeout(function ()
|
1076
|
+
{
|
1077
|
+
obj.container.removeChild(doc.getElementById('rgraph_hscissors_0_' + obj.id));
|
1078
|
+
obj.container.removeChild(doc.getElementById('rgraph_hscissors_1_' + obj.id));
|
1079
|
+
obj.container.removeChild(doc.getElementById('rgraph_hscissors_2_' + obj.id));
|
1080
|
+
obj.container.removeChild(doc.getElementById('rgraph_hscissors_3_' + obj.id));
|
1081
|
+
obj.container.removeChild(doc.getElementById('rgraph_hscissors_4_' + obj.id));
|
1082
|
+
|
1083
|
+
callback(obj);
|
1084
|
+
}, duration);
|
1085
|
+
|
1086
|
+
|
1087
|
+
return this;
|
1088
|
+
};
|
1089
|
+
|
1090
|
+
|
1091
|
+
|
1092
|
+
|
1093
|
+
|
1094
|
+
|
1095
|
+
|
1096
|
+
|
1097
|
+
//
|
1098
|
+
// Horizontal Scissors (Close)
|
1099
|
+
//
|
1100
|
+
// This function gets added to the chart object - so the this
|
1101
|
+
// variable is the chart object
|
1102
|
+
//
|
1103
|
+
// @param @object Optional object of options
|
1104
|
+
// @param function Optional callback function
|
1105
|
+
//
|
1106
|
+
//
|
1107
|
+
RGraph.SVG.FX.hscissorsclose = function ()
|
1108
|
+
{
|
1109
|
+
var obj = this,
|
1110
|
+
opt = arguments[0] || {},
|
1111
|
+
frames = opt.frames || 60,
|
1112
|
+
duration = (frames / 60) * 1000,
|
1113
|
+
frame = 0,
|
1114
|
+
callback = opt.callback || function () {},
|
1115
|
+
color = opt.color || 'white',
|
1116
|
+
height = this.container.offsetHeight / 5;
|
1117
|
+
|
1118
|
+
|
1119
|
+
for (var i=0; i<5; ++i) {
|
1120
|
+
var div = doc.createElement('DIV');
|
1121
|
+
div.id = 'rgraph_hscissors_' + i + '_' + this.id;
|
1122
|
+
div.style.width = 0;
|
1123
|
+
div.style.height = height + 'px';
|
1124
|
+
div.style.left = (i % 2 == 0 ? this.container.offsetWidth : 0) + 'px';
|
1125
|
+
div.style.top = (this.container.offsetHeight * (i / 5)) + 'px';
|
1126
|
+
div.style.position = 'absolute';
|
1127
|
+
div.style.backgroundColor = color;
|
1128
|
+
this.container.appendChild(div);
|
1129
|
+
|
1130
|
+
if (i % 2 == 0) {
|
1131
|
+
jQuery('#' + 'rgraph_hscissors_' + i + '_' + this.id).animate({left: 0, width: this.container.offsetWidth + 'px'}, duration);
|
1132
|
+
} else {
|
1133
|
+
jQuery('#' + 'rgraph_hscissors_' + i + '_' + this.id).animate({width: this.container.offsetWidth + 'px'}, duration);
|
1134
|
+
}
|
1135
|
+
}
|
1136
|
+
|
1137
|
+
setTimeout(function ()
|
1138
|
+
{
|
1139
|
+
RGraph.SVG.clear(obj.svg);
|
1140
|
+
jQuery('#' + 'rgraph_hscissors_' + 0 + '_' + obj.id).remove();
|
1141
|
+
jQuery('#' + 'rgraph_hscissors_' + 1 + '_' + obj.id).remove();
|
1142
|
+
jQuery('#' + 'rgraph_hscissors_' + 2 + '_' + obj.id).remove();
|
1143
|
+
jQuery('#' + 'rgraph_hscissors_' + 3 + '_' + obj.id).remove();
|
1144
|
+
jQuery('#' + 'rgraph_hscissors_' + 4 + '_' + obj.id).remove();
|
1145
|
+
callback(obj);
|
1146
|
+
}, duration);
|
1147
|
+
|
1148
|
+
return this;
|
1149
|
+
};
|
1150
|
+
|
1151
|
+
|
1152
|
+
|
1153
|
+
|
1154
|
+
|
1155
|
+
|
1156
|
+
|
1157
|
+
|
1158
|
+
//
|
1159
|
+
// Vertical Scissors (open)
|
1160
|
+
//
|
1161
|
+
// @param @object Optional An object of options. It can consist of:
|
1162
|
+
// o color - The color of the scissors. The default is white
|
1163
|
+
// o frames - Number of animation frames in the effect. Default
|
1164
|
+
// is 60
|
1165
|
+
// o callback - A function that's called when the effect is
|
1166
|
+
// finished
|
1167
|
+
//
|
1168
|
+
RGraph.SVG.FX.vscissorsopen = function ()
|
1169
|
+
{
|
1170
|
+
// This function gets added to the chart object - so the this
|
1171
|
+
// variable is the chart object
|
1172
|
+
var obj = this,
|
1173
|
+
opt = arguments[0] || {},
|
1174
|
+
frames = opt.frames || 90,
|
1175
|
+
duration = (frames / 60) * 1000,
|
1176
|
+
frame = 0,
|
1177
|
+
callback = opt.callback || function () {},
|
1178
|
+
color = opt.color || 'white',
|
1179
|
+
width = this.container.offsetWidth / 10;
|
1180
|
+
|
1181
|
+
|
1182
|
+
|
1183
|
+
//
|
1184
|
+
// First (re)draw the chart
|
1185
|
+
//
|
1186
|
+
RGraph.SVG.redraw(this.svg);
|
1187
|
+
|
1188
|
+
|
1189
|
+
|
1190
|
+
for (var i=0; i<10; ++i) {
|
1191
|
+
var div = doc.getElementById("rgraph_vscissors_" + i + '_' + this.id);
|
1192
|
+
|
1193
|
+
if (!div) {
|
1194
|
+
var div = doc.createElement('DIV');
|
1195
|
+
div.id = 'rgraph_vscissors_' + i + '_' + this.id;
|
1196
|
+
div.style.width = width + 'px';
|
1197
|
+
div.style.height = this.container.offsetHeight + 'px';
|
1198
|
+
div.style.left = this.container.offsetWidth * (i / 10) + 'px';
|
1199
|
+
div.style.top = 0;
|
1200
|
+
div.style.position = 'absolute';
|
1201
|
+
div.style.backgroundColor = color;
|
1202
|
+
this.container.appendChild(div);
|
1203
|
+
}
|
1204
|
+
|
1205
|
+
if (i % 2 == 0) {
|
1206
|
+
jQuery('#' + 'rgraph_vscissors_' + i + '_' + this.id).animate({top: this.container.offsetHeight + 'px', height: 0}, duration);
|
1207
|
+
} else {
|
1208
|
+
jQuery('#' + 'rgraph_vscissors_' + i + '_' + this.id).animate({height: 0}, duration);
|
1209
|
+
}
|
1210
|
+
}
|
1211
|
+
|
1212
|
+
setTimeout(function ()
|
1213
|
+
{
|
1214
|
+
obj.container.removeChild(doc.getElementById('rgraph_vscissors_0' + '_' + obj.id));
|
1215
|
+
obj.container.removeChild(doc.getElementById('rgraph_vscissors_1' + '_' + obj.id));
|
1216
|
+
obj.container.removeChild(doc.getElementById('rgraph_vscissors_2' + '_' + obj.id));
|
1217
|
+
obj.container.removeChild(doc.getElementById('rgraph_vscissors_3' + '_' + obj.id));
|
1218
|
+
obj.container.removeChild(doc.getElementById('rgraph_vscissors_4' + '_' + obj.id));
|
1219
|
+
|
1220
|
+
callback(obj);
|
1221
|
+
|
1222
|
+
}, duration);
|
1223
|
+
|
1224
|
+
return this;
|
1225
|
+
};
|
1226
|
+
|
1227
|
+
|
1228
|
+
|
1229
|
+
|
1230
|
+
|
1231
|
+
|
1232
|
+
|
1233
|
+
|
1234
|
+
//
|
1235
|
+
// Vertical Scissors (close)
|
1236
|
+
//
|
1237
|
+
RGraph.SVG.FX.vscissorsclose = function ()
|
1238
|
+
{
|
1239
|
+
// This function gets added to the chart object - so the this
|
1240
|
+
// variable is the chart object
|
1241
|
+
var obj = this,
|
1242
|
+
opt = arguments[0] || {},
|
1243
|
+
frames = opt.frames || 90,
|
1244
|
+
duration = (frames / 60) * 1000,
|
1245
|
+
frame = 0,
|
1246
|
+
callback = opt.callback || function () {},
|
1247
|
+
color = opt.color || 'white',
|
1248
|
+
width = this.container.offsetWidth / 10;
|
1249
|
+
|
1250
|
+
|
1251
|
+
for (var i=0; i<10; ++i) {
|
1252
|
+
var div = doc.getElementById("rgraph_vscissors_" + i + '_' + this.id)
|
1253
|
+
if (!div) {
|
1254
|
+
var div = doc.createElement('DIV');
|
1255
|
+
div.id = 'rgraph_vscissors_' + i + '_' + this.id;
|
1256
|
+
div.style.width = width + 'px';
|
1257
|
+
div.style.height = 0;
|
1258
|
+
div.style.left = (width * i) + 'px';
|
1259
|
+
div.style.top = (i % 2 == 0 ? this.container.offsetHeight : 0) + 'px';
|
1260
|
+
div.style.position = 'absolute';
|
1261
|
+
div.style.backgroundColor = color;
|
1262
|
+
this.container.appendChild(div);
|
1263
|
+
}
|
1264
|
+
|
1265
|
+
if (i % 2 == 0) {
|
1266
|
+
jQuery('#' + 'rgraph_vscissors_' + i + '_' + this.id).animate({top: 0, height: this.container.offsetHeight + 'px'}, duration);
|
1267
|
+
} else {
|
1268
|
+
jQuery('#' + 'rgraph_vscissors_' + i + '_' + this.id).animate({height: this.container.offsetHeight + 'px'}, duration);
|
1269
|
+
}
|
1270
|
+
}
|
1271
|
+
|
1272
|
+
setTimeout(function ()
|
1273
|
+
{
|
1274
|
+
RGraph.SVG.clear(obj.svg);
|
1275
|
+
for (var i=0; i<10; i++) {
|
1276
|
+
jQuery('#rgraph_vscissors_' + i + '_' + obj.id).remove();
|
1277
|
+
}
|
1278
|
+
callback(obj);
|
1279
|
+
}, duration);
|
1280
|
+
|
1281
|
+
return this;
|
1282
|
+
};
|
1283
|
+
|
1284
|
+
|
1285
|
+
|
1286
|
+
|
1287
|
+
|
1288
|
+
|
1289
|
+
|
1290
|
+
|
1291
|
+
// End Module pattern
|
1292
|
+
})(window, document);
|