rgraph-rails 4.62 → 4.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +3 -4
  3. data/lib/rgraph-rails/version.rb +1 -1
  4. data/vendor/assets/javascripts/RGraph.bar.js +240 -3742
  5. data/vendor/assets/javascripts/RGraph.bipolar.js +165 -2005
  6. data/vendor/assets/javascripts/RGraph.common.annotate.js +35 -395
  7. data/vendor/assets/javascripts/RGraph.common.context.js +30 -595
  8. data/vendor/assets/javascripts/RGraph.common.core.js +418 -5359
  9. data/vendor/assets/javascripts/RGraph.common.csv.js +20 -276
  10. data/vendor/assets/javascripts/RGraph.common.deprecated.js +35 -450
  11. data/vendor/assets/javascripts/RGraph.common.dynamic.js +88 -1395
  12. data/vendor/assets/javascripts/RGraph.common.effects.js +90 -1545
  13. data/vendor/assets/javascripts/RGraph.common.key.js +52 -753
  14. data/vendor/assets/javascripts/RGraph.common.resizing.js +37 -563
  15. data/vendor/assets/javascripts/RGraph.common.sheets.js +29 -352
  16. data/vendor/assets/javascripts/RGraph.common.tooltips.js +32 -450
  17. data/vendor/assets/javascripts/RGraph.common.zoom.js +14 -219
  18. data/vendor/assets/javascripts/RGraph.cornergauge.js +71 -0
  19. data/vendor/assets/javascripts/RGraph.drawing.background.js +34 -570
  20. data/vendor/assets/javascripts/RGraph.drawing.circle.js +33 -544
  21. data/vendor/assets/javascripts/RGraph.drawing.image.js +51 -755
  22. data/vendor/assets/javascripts/RGraph.drawing.marker1.js +37 -645
  23. data/vendor/assets/javascripts/RGraph.drawing.marker2.js +36 -633
  24. data/vendor/assets/javascripts/RGraph.drawing.marker3.js +35 -514
  25. data/vendor/assets/javascripts/RGraph.drawing.poly.js +37 -559
  26. data/vendor/assets/javascripts/RGraph.drawing.rect.js +33 -548
  27. data/vendor/assets/javascripts/RGraph.drawing.text.js +36 -664
  28. data/vendor/assets/javascripts/RGraph.drawing.xaxis.js +50 -812
  29. data/vendor/assets/javascripts/RGraph.drawing.yaxis.js +51 -856
  30. data/vendor/assets/javascripts/RGraph.fuel.js +58 -964
  31. data/vendor/assets/javascripts/RGraph.funnel.js +55 -984
  32. data/vendor/assets/javascripts/RGraph.gantt.js +77 -1354
  33. data/vendor/assets/javascripts/RGraph.gauge.js +85 -1421
  34. data/vendor/assets/javascripts/RGraph.hbar.js +162 -2788
  35. data/vendor/assets/javascripts/RGraph.hprogress.js +80 -1401
  36. data/vendor/assets/javascripts/RGraph.line.js +249 -4248
  37. data/vendor/assets/javascripts/RGraph.meter.js +74 -1280
  38. data/vendor/assets/javascripts/RGraph.modaldialog.js +19 -301
  39. data/vendor/assets/javascripts/RGraph.odo.js +71 -1264
  40. data/vendor/assets/javascripts/RGraph.pie.js +137 -2288
  41. data/vendor/assets/javascripts/RGraph.radar.js +110 -1847
  42. data/vendor/assets/javascripts/RGraph.rose.js +108 -1977
  43. data/vendor/assets/javascripts/RGraph.rscatter.js +80 -1432
  44. data/vendor/assets/javascripts/RGraph.scatter.js +172 -3163
  45. data/vendor/assets/javascripts/RGraph.semicircularprogress.js +60 -1120
  46. data/vendor/assets/javascripts/RGraph.svg.bar.js +66 -1735
  47. data/vendor/assets/javascripts/RGraph.svg.common.ajax.js +21 -246
  48. data/vendor/assets/javascripts/RGraph.svg.common.core.js +255 -3937
  49. data/vendor/assets/javascripts/RGraph.svg.common.csv.js +20 -276
  50. data/vendor/assets/javascripts/RGraph.svg.common.fx.js +68 -1303
  51. data/vendor/assets/javascripts/RGraph.svg.common.key.js +19 -205
  52. data/vendor/assets/javascripts/RGraph.svg.common.sheets.js +29 -352
  53. data/vendor/assets/javascripts/RGraph.svg.common.tooltips.js +22 -273
  54. data/vendor/assets/javascripts/RGraph.svg.funnel.js +32 -0
  55. data/vendor/assets/javascripts/RGraph.svg.hbar.js +59 -1400
  56. data/vendor/assets/javascripts/RGraph.svg.line.js +70 -1580
  57. data/vendor/assets/javascripts/RGraph.svg.pie.js +55 -1131
  58. data/vendor/assets/javascripts/RGraph.svg.radar.js +57 -1502
  59. data/vendor/assets/javascripts/RGraph.svg.rose.js +66 -1817
  60. data/vendor/assets/javascripts/RGraph.svg.scatter.js +58 -1261
  61. data/vendor/assets/javascripts/RGraph.svg.semicircularprogress.js +28 -865
  62. data/vendor/assets/javascripts/RGraph.svg.waterfall.js +45 -1252
  63. data/vendor/assets/javascripts/RGraph.thermometer.js +63 -1136
  64. data/vendor/assets/javascripts/RGraph.vprogress.js +83 -1470
  65. data/vendor/assets/javascripts/RGraph.waterfall.js +83 -1347
  66. metadata +5 -4
  67. data/vendor/assets/javascripts/financial-data.js +0 -1067
@@ -1,545 +1,34 @@
1
- // version: 2017-05-08
2
- /**
3
- * o--------------------------------------------------------------------------------o
4
- * | This file is part of the RGraph package - you can learn more at: |
5
- * | |
6
- * | http://www.rgraph.net |
7
- * | |
8
- * | RGraph is licensed under the Open Source MIT license. That means that it's |
9
- * | totally free to use! |
10
- * o--------------------------------------------------------------------------------o
11
- */
12
-
13
- /**
14
- * Having this here means that the RGraph libraries can be included in any order, instead of you having
15
- * to include the common core library first.
16
- */
17
1
 
18
- // Define the RGraph global variable
19
- RGraph = window.RGraph || {isRGraph: true};
20
- RGraph.Drawing = RGraph.Drawing || {};
21
-
22
- /**
23
- * The constructor. This function sets up the object. It takes the ID (the HTML attribute) of the canvas as the
24
- * first argument and the data as the second. If you need to change this, you can.
25
- *
26
- * @param string id The canvas tag ID
27
- * @param number x The X position of the circle
28
- * @param number y The Y position of the circle
29
- * @param number r The radius of the circle
30
- */
31
- RGraph.Drawing.Circle = function (conf)
32
- {
33
- /**
34
- * Allow for object config style
35
- */
36
- if ( typeof conf === 'object'
37
- && typeof conf.x === 'number'
38
- && typeof conf.y === 'number'
39
- && typeof conf.radius === 'number'
40
- && typeof conf.id === 'string') {
41
-
42
- var id = conf.id,
43
- canvas = document.getElementById(id),
44
- x = conf.x,
45
- y = conf.y,
46
- radius = conf.radius,
47
- parseConfObjectForOptions = true; // Set this so the config is parsed (at the end of the constructor)
48
-
49
- } else {
50
-
51
- var id = conf,
52
- canvas = document.getElementById(id),
53
- x = arguments[1],
54
- y = arguments[2],
55
- radius = arguments[3];
56
- }
57
-
58
-
59
-
60
-
61
- this.id = id;
62
- this.canvas = document.getElementById(this.id);
63
- this.context = this.canvas.getContext('2d');
64
- this.canvas.__object__ = this;
65
- this.original_colors = [];
66
- this.firstDraw = true; // After the first draw this will be false
67
-
68
-
69
- /**
70
- * Store the properties
71
- */
72
- this.centerx = x;
73
- this.centery = y;
74
- this.radius = radius;
75
-
76
- /**
77
- * This defines the type of this shape
78
- */
79
- this.type = 'drawing.circle';
80
-
81
-
82
- /**
83
- * This facilitates easy object identification, and should always be true
84
- */
85
- this.isRGraph = true;
86
-
87
-
88
- /**
89
- * This adds a uid to the object that you can use for identification purposes
90
- */
91
- this.uid = RGraph.createUID();
92
-
93
-
94
- /**
95
- * This adds a UID to the canvas for identification purposes
96
- */
97
- this.canvas.uid = this.canvas.uid ? this.canvas.uid : RGraph.createUID();
98
-
99
-
100
-
101
-
102
- /**
103
- * Some example background properties
104
- */
105
- this.properties =
106
- {
107
- 'chart.strokestyle': 'rgba(0,0,0,0)',
108
- 'chart.fillstyle': 'red',
109
- 'chart.events.click': null,
110
- 'chart.events.mousemove': null,
111
- 'chart.shadow': false,
112
- 'chart.shadow.color': 'gray',
113
- 'chart.shadow.offsetx': 3,
114
- 'chart.shadow.offsety': 3,
115
- 'chart.shadow.blur': 5,
116
- 'chart.highlight.stroke': 'black',
117
- 'chart.highlight.fill': 'rgba(255,255,255,0.7)',
118
- 'chart.tooltips': null,
119
- 'chart.tooltips.highlight': true,
120
- 'chart.tooltips.event': 'onclick',
121
- 'chart.linewidth': 2,
122
- 'chart.clearto': 'rgba(0,0,0,0)'
123
- }
124
-
125
- /**
126
- * A simple check that the browser has canvas support
127
- */
128
- if (!this.canvas) {
129
- alert('[DRAWING.CIRCLE] No canvas support');
130
- return;
131
- }
132
-
133
- /**
134
- * This can be used to store the coordinates of shapes on the graph
135
- */
136
- this.coords = [[
137
- this.centerx,
138
- this.centery,
139
- this.radius
140
- ]];
141
-
142
-
143
- /**
144
- * Create the dollar object so that functions can be added to them
145
- */
146
- this.$0 = {};
147
-
148
-
149
-
150
- /**
151
- * Translate half a pixel for antialiasing purposes - but only if it hasn't beeen
152
- * done already
153
- */
154
- if (!this.canvas.__rgraph_aa_translated__) {
155
- this.context.translate(0.5,0.5);
156
- this.canvas.__rgraph_aa_translated__ = true;
157
- }
158
-
159
-
160
-
161
-
162
- // Short variable names
163
- var RG = RGraph,
164
- ca = this.canvas,
165
- co = ca.getContext('2d'),
166
- prop = this.properties,
167
- pa2 = RG.path2,
168
- win = window,
169
- doc = document,
170
- ma = Math;
171
-
172
-
173
-
174
- /**
175
- * "Decorate" the object with the generic effects if the effects library has been included
176
- */
177
- if (RG.Effects && typeof RG.Effects.decorate === 'function') {
178
- RG.Effects.decorate(this);
179
- }
180
-
181
-
182
-
183
-
184
- /**
185
- * A setter method for setting graph properties. It can be used like this: obj.Set('chart.strokestyle', '#666');
186
- *
187
- * @param name string The name of the property to set OR it can be a map
188
- * of name/value settings like what you set in the constructor
189
- */
190
- this.set =
191
- this.Set = function (name)
192
- {
193
- var value = typeof arguments[1] === 'undefined' ? null : arguments[1];
194
-
195
- /**
196
- * the number of arguments is only one and it's an
197
- * object - parse it for configuration data and return.
198
- */
199
- if (arguments.length === 1 && typeof name === 'object') {
200
- RG.parseObjectStyleConfig(this, name);
201
- return this;
202
- }
203
-
204
-
205
-
206
-
207
-
208
- /**
209
- * This should be done first - prepend the property name with "chart." if necessary
210
- */
211
- if (name.substr(0,6) != 'chart.') {
212
- name = 'chart.' + name;
213
- }
214
-
215
-
216
-
217
-
218
- // Convert uppercase letters to dot+lower case letter
219
- while(name.match(/([A-Z])/)) {
220
- name = name.replace(/([A-Z])/, '.' + RegExp.$1.toLowerCase());
221
- }
222
-
223
-
224
-
225
-
226
-
227
-
228
- prop[name] = value;
229
-
230
- return this;
231
- };
232
-
233
-
234
-
235
-
236
- /**
237
- * A getter method for retrieving graph properties. It can be used like this: obj.Get('chart.strokestyle');
238
- *
239
- * @param name string The name of the property to get
240
- */
241
- this.get =
242
- this.Get = function (name)
243
- {
244
- /**
245
- * This should be done first - prepend the property name with "chart." if necessary
246
- */
247
- if (name.substr(0,6) != 'chart.') {
248
- name = 'chart.' + name;
249
- }
250
-
251
- // Convert uppercase letters to dot+lower case letter
252
- while(name.match(/([A-Z])/)) {
253
- name = name.replace(/([A-Z])/, '.' + RegExp.$1.toLowerCase());
254
- }
255
-
256
- return prop[name.toLowerCase()];
257
- };
258
-
259
-
260
-
261
-
262
- /**
263
- * Draws the circle
264
- */
265
- this.draw =
266
- this.Draw = function ()
267
- {
268
- /**
269
- * Fire the onbeforedraw event
270
- */
271
- RG.fireCustomEvent(this, 'onbeforedraw');
272
-
273
-
274
- /**
275
- * Parse the colors. This allows for simple gradient syntax
276
- */
277
- if (!this.colorsParsed) {
278
-
279
- this.parseColors();
280
-
281
- // Don't want to do this again
282
- this.colorsParsed = true;
283
- }
284
-
285
- pa2(co, 'b lw %',prop['chart.linewidth']);
286
-
287
- if (prop['chart.shadow']) {
288
- RG.setShadow(
289
- this,
290
- prop['chart.shadow.color'],
291
- prop['chart.shadow.offsetx'],
292
- prop['chart.shadow.offsety'],
293
- prop['chart.shadow.blur']
294
- );
295
- }
296
-
297
- pa2(co,
298
- 'b a % % % % % % f % s %',
299
- this.coords[0][0],
300
- this.coords[0][1],
301
- this.radius, 0,
302
- RG.TWOPI,
303
- false,
304
- prop['chart.fillstyle'],
305
- prop['chart.strokestyle'
306
- ]);
307
-
308
- // Must turn the shadow off before the fill is done
309
- RG.noShadow(this);
310
-
311
-
312
- /**
313
- * This installs the event listeners
314
- */
315
- RG.installEventListeners(this);
316
-
317
-
318
- /**
319
- * Fire the onfirstdraw event
320
- */
321
- if (this.firstDraw) {
322
- RG.fireCustomEvent(this, 'onfirstdraw');
323
- this.firstDraw = false;
324
- this.firstDrawFunc();
325
- }
326
-
327
-
328
-
329
- /**
330
- * Fire the ondraw event
331
- */
332
- RG.fireCustomEvent(this, 'ondraw');
333
-
334
- return this;
335
- };
336
-
337
-
338
-
339
- /**
340
- * Used in chaining. Runs a function there and then - not waiting for
341
- * the events to fire (eg the onbeforedraw event)
342
- *
343
- * @param function func The function to execute
344
- */
345
- this.exec = function (func)
346
- {
347
- func(this);
348
-
349
- return this;
350
- };
351
-
352
-
353
-
354
-
355
- /**
356
- * The getObjectByXY() worker method
357
- */
358
- this.getObjectByXY = function (e)
359
- {
360
- if (this.getShape(e)) {
361
- return this;
362
- }
363
- };
364
-
365
-
366
-
367
-
368
- /**
369
- * Not used by the class during creating the shape, but is used by event handlers
370
- * to get the coordinates (if any) of the selected bar
371
- *
372
- * @param object e The event object
373
- * @param object OPTIONAL You can pass in the bar object instead of the
374
- * function using "this"
375
- */
376
- this.getShape = function (e)
377
- {
378
- var mouseXY = RG.getMouseXY(e),
379
- mouseX = mouseXY[0],
380
- mouseY = mouseXY[1];
381
-
382
- if (RG.getHypLength(this.centerx, this.centery, mouseXY[0], mouseXY[1]) <= this.radius) {
383
-
384
- return {
385
- 0: this, 1: this.centerx, 2: this.centery, 3: this.radius, 4: null, 5: 0,
386
- 'object': this, 'x': this.centerx, 'y': this.centery, 'radius': this.radius, 'index': 0, 'tooltip': prop['chart.tooltips'] ? prop['chart.tooltips'][0] : null
387
- };
388
- }
389
-
390
- return null;
391
- };
392
-
393
-
394
-
395
-
396
- /**
397
- * Each object type has its own Highlight() function which highlights the appropriate shape
398
- *
399
- * @param object shape The shape to highlight
400
- */
401
- this.highlight =
402
- this.Highlight = function (shape)
403
- {
404
- if (prop['chart.tooltips.highlight']) {
405
- if (typeof prop['chart.highlight.style'] === 'function') {
406
- (prop['chart.highlight.style'])(shape);
407
- } else {
408
- //pa2(co, ['b','a',this.centerx, this.centery, this.radius + 0.5, 0, RGraph.TWOPI, false,'f',prop['chart.highlight.fill'],'s',prop['chart.highlight.stroke']]);
409
- pa2(co,
410
- 'b a % % % % % % f % s %',
411
- this.centerx,
412
- this.centery,
413
- this.radius + 0.5,
414
- 0,
415
- RG.TWOPI,
416
- false,
417
- prop['chart.highlight.fill'],
418
- prop['chart.highlight.stroke']
419
- );
420
- }
421
- }
422
- };
423
-
424
-
425
-
426
-
427
- /**
428
- * This allows for easy specification of gradients
429
- */
430
- this.parseColors = function ()
431
- {
432
- // Save the original colors so that they can be restored when the canvas is reset
433
- if (this.original_colors.length === 0) {
434
- this.original_colors['chart.fillstyle'] = RG.array_clone(prop['chart.fillstyle']);
435
- this.original_colors['chart.strokestyle'] = RG.array_clone(prop['chart.strokestyle']);
436
- this.original_colors['chart.highlight.stroke'] = RG.array_clone(prop['chart.highlight.stroke']);
437
- this.original_colors['chart.highlight.fill'] = RG.array_clone(prop['chart.highlight.fill']);
438
- }
439
-
440
-
441
-
442
-
443
- /**
444
- * Parse various properties for colors
445
- */
446
- prop['chart.fillstyle'] = this.parseSingleColorForGradient(prop['chart.fillstyle']);
447
- prop['chart.strokestyle'] = this.parseSingleColorForGradient(prop['chart.strokestyle']);
448
- prop['chart.highlight.stroke'] = this.parseSingleColorForGradient(prop['chart.highlight.stroke']);
449
- prop['chart.highlight.fill'] = this.parseSingleColorForGradient(prop['chart.highlight.fill']);
450
- };
451
-
452
-
453
-
454
-
455
- /**
456
- * Use this function to reset the object to the post-constructor state. Eg reset colors if
457
- * need be etc
458
- */
459
- this.reset = function ()
460
- {
461
- };
462
-
463
-
464
-
465
-
466
- /**
467
- * This parses a single color value
468
- */
469
- this.parseSingleColorForGradient = function (color)
470
- {
471
- if (!color) {
472
- return color;
473
- }
474
-
475
- if (typeof color === 'string' && color.match(/^gradient\((.*)\)$/i)) {
476
-
477
- var parts = RegExp.$1.split(':');
478
-
479
- // Create the gradient
480
- var grad = co.createRadialGradient(this.centerx, this.centery, 0, this.centerx, this.centery, this.radius),
481
- diff = 1 / (parts.length - 1);
482
-
483
-
484
- for (var j=0; j<parts.length; j+=1) {
485
- grad.addColorStop(j * diff, RG.trim(parts[j]));
486
- }
487
- }
488
-
489
- return grad ? grad : color;
490
- };
491
-
492
-
493
-
494
-
495
- /**
496
- * Using a function to add events makes it easier to facilitate method chaining
497
- *
498
- * @param string type The type of even to add
499
- * @param function func
500
- */
501
- this.on = function (type, func)
502
- {
503
- if (type.substr(0,2) !== 'on') {
504
- type = 'on' + type;
505
- }
506
-
507
- if (typeof this[type] !== 'function') {
508
- this[type] = func;
509
- } else {
510
- RG.addCustomEventListener(this, type, func);
511
- }
512
-
513
- return this;
514
- };
515
-
516
-
517
-
518
-
519
- /**
520
- * This function runs once only
521
- * (put at the end of the file (before any effects))
522
- */
523
- this.firstDrawFunc = function ()
524
- {
525
- };
526
-
527
-
528
-
529
-
530
- /**
531
- * Objects are now always registered so that the chart is redrawn if need be.
532
- */
533
- RG.register(this);
534
-
535
-
536
-
537
-
538
- /**
539
- * This is the 'end' of the constructor so if the first argument
540
- * contains configuration data - handle that.
541
- */
542
- if (parseConfObjectForOptions) {
543
- RG.parseObjectStyleConfig(this, conf.options);
544
- }
545
- };
2
+ RGraph=window.RGraph||{isRGraph:true};RGraph.Drawing=RGraph.Drawing||{};RGraph.Drawing.Circle=function(conf)
3
+ {if(typeof conf==='object'&&typeof conf.x==='number'&&typeof conf.y==='number'&&typeof conf.radius==='number'&&typeof conf.id==='string'){var id=conf.id,canvas=document.getElementById(id),x=conf.x,y=conf.y,radius=conf.radius,parseConfObjectForOptions=true;}else{var id=conf,canvas=document.getElementById(id),x=arguments[1],y=arguments[2],radius=arguments[3];}
4
+ this.id=id;this.canvas=document.getElementById(this.id);this.context=this.canvas.getContext('2d');this.canvas.__object__=this;this.original_colors=[];this.firstDraw=true;this.centerx=x;this.centery=y;this.radius=radius;this.type='drawing.circle';this.isRGraph=true;this.uid=RGraph.createUID();this.canvas.uid=this.canvas.uid?this.canvas.uid:RGraph.createUID();this.properties={'chart.strokestyle':'rgba(0,0,0,0)','chart.fillstyle':'red','chart.events.click':null,'chart.events.mousemove':null,'chart.shadow':false,'chart.shadow.color':'gray','chart.shadow.offsetx':3,'chart.shadow.offsety':3,'chart.shadow.blur':5,'chart.highlight.stroke':'black','chart.highlight.fill':'rgba(255,255,255,0.7)','chart.tooltips':null,'chart.tooltips.highlight':true,'chart.tooltips.event':'onclick','chart.linewidth':2,'chart.clearto':'rgba(0,0,0,0)'}
5
+ if(!this.canvas){alert('[DRAWING.CIRCLE] No canvas support');return;}
6
+ this.coords=[[this.centerx,this.centery,this.radius]];this.$0={};if(!this.canvas.__rgraph_aa_translated__){this.context.translate(0.5,0.5);this.canvas.__rgraph_aa_translated__=true;}
7
+ var RG=RGraph,ca=this.canvas,co=ca.getContext('2d'),prop=this.properties,pa2=RG.path2,win=window,doc=document,ma=Math;if(RG.Effects&&typeof RG.Effects.decorate==='function'){RG.Effects.decorate(this);}
8
+ this.set=this.Set=function(name)
9
+ {var value=typeof arguments[1]==='undefined'?null:arguments[1];if(arguments.length===1&&typeof name==='object'){RG.parseObjectStyleConfig(this,name);return this;}
10
+ if(name.substr(0,6)!='chart.'){name='chart.'+name;}
11
+ while(name.match(/([A-Z])/)){name=name.replace(/([A-Z])/,'.'+RegExp.$1.toLowerCase());}
12
+ prop[name]=value;return this;};this.get=this.Get=function(name)
13
+ {if(name.substr(0,6)!='chart.'){name='chart.'+name;}
14
+ while(name.match(/([A-Z])/)){name=name.replace(/([A-Z])/,'.'+RegExp.$1.toLowerCase());}
15
+ return prop[name.toLowerCase()];};this.draw=this.Draw=function()
16
+ {RG.fireCustomEvent(this,'onbeforedraw');if(!this.colorsParsed){this.parseColors();this.colorsParsed=true;}
17
+ pa2(co,'b lw %',prop['chart.linewidth']);if(prop['chart.shadow']){RG.setShadow(this,prop['chart.shadow.color'],prop['chart.shadow.offsetx'],prop['chart.shadow.offsety'],prop['chart.shadow.blur']);}
18
+ pa2(co,'b a % % % % % % f % s %',this.coords[0][0],this.coords[0][1],this.radius,0,RG.TWOPI,false,prop['chart.fillstyle'],prop['chart.strokestyle']);RG.noShadow(this);RG.installEventListeners(this);if(this.firstDraw){this.firstDraw=false;RG.fireCustomEvent(this,'onfirstdraw');this.firstDrawFunc();}
19
+ RG.fireCustomEvent(this,'ondraw');return this;};this.exec=function(func)
20
+ {func(this);return this;};this.getObjectByXY=function(e)
21
+ {if(this.getShape(e)){return this;}};this.getShape=function(e)
22
+ {var mouseXY=RG.getMouseXY(e),mouseX=mouseXY[0],mouseY=mouseXY[1];if(RG.getHypLength(this.centerx,this.centery,mouseXY[0],mouseXY[1])<=this.radius){return{0:this,1:this.centerx,2:this.centery,3:this.radius,4:null,5:0,'object':this,'x':this.centerx,'y':this.centery,'radius':this.radius,'index':0,'tooltip':prop['chart.tooltips']?prop['chart.tooltips'][0]:null};}
23
+ return null;};this.highlight=this.Highlight=function(shape)
24
+ {if(prop['chart.tooltips.highlight']){if(typeof prop['chart.highlight.style']==='function'){(prop['chart.highlight.style'])(shape);}else{pa2(co,'b a % % % % % % f % s %',this.centerx,this.centery,this.radius+0.5,0,RG.TWOPI,false,prop['chart.highlight.fill'],prop['chart.highlight.stroke']);}}};this.parseColors=function()
25
+ {if(this.original_colors.length===0){this.original_colors['chart.fillstyle']=RG.array_clone(prop['chart.fillstyle']);this.original_colors['chart.strokestyle']=RG.array_clone(prop['chart.strokestyle']);this.original_colors['chart.highlight.stroke']=RG.array_clone(prop['chart.highlight.stroke']);this.original_colors['chart.highlight.fill']=RG.array_clone(prop['chart.highlight.fill']);}
26
+ prop['chart.fillstyle']=this.parseSingleColorForGradient(prop['chart.fillstyle']);prop['chart.strokestyle']=this.parseSingleColorForGradient(prop['chart.strokestyle']);prop['chart.highlight.stroke']=this.parseSingleColorForGradient(prop['chart.highlight.stroke']);prop['chart.highlight.fill']=this.parseSingleColorForGradient(prop['chart.highlight.fill']);};this.reset=function()
27
+ {};this.parseSingleColorForGradient=function(color)
28
+ {if(!color){return color;}
29
+ if(typeof color==='string'&&color.match(/^gradient\((.*)\)$/i)){var parts=RegExp.$1.split(':');var grad=co.createRadialGradient(this.centerx,this.centery,0,this.centerx,this.centery,this.radius),diff=1/(parts.length-1);for(var j=0;j<parts.length;j+=1){grad.addColorStop(j*diff,RG.trim(parts[j]));}}
30
+ return grad?grad:color;};this.on=function(type,func)
31
+ {if(type.substr(0,2)!=='on'){type='on'+type;}
32
+ if(typeof this[type]!=='function'){this[type]=func;}else{RG.addCustomEventListener(this,type,func);}
33
+ return this;};this.firstDrawFunc=function()
34
+ {};RG.register(this);if(parseConfObjectForOptions){RG.parseObjectStyleConfig(this,conf.options);}};