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,560 +1,38 @@
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, then the coordinates of the coords of the shape
25
- *
26
- * @param string id The canvas tag ID
27
- * @param number coords The coordinates of the shape
28
- */
29
- RGraph.Drawing.Poly = function (conf)
30
- {
31
- /**
32
- * Allow for object config style
33
- */
34
- if ( typeof conf === 'object'
35
- && typeof conf.coords === 'object'
36
- && typeof conf.id === 'string') {
37
-
38
- var id = conf.id,
39
- coords = conf.coords,
40
- parseConfObjectForOptions = true; // Set this so the config is parsed (at the end of the constructor)
41
- } else {
42
- var id = conf,
43
- coords = arguments[1];
44
- }
45
-
46
-
47
-
48
-
49
- this.id = id;
50
- this.canvas = document.getElementById(this.id);
51
- this.context = this.canvas.getContext('2d');
52
- this.colorsParsed = false;
53
- this.canvas.__object__ = this;
54
- this.coords = coords;
55
- this.coordsText = [];
56
- this.original_colors = [];
57
- this.firstDraw = true; // After the first draw this will be false
58
-
59
-
60
- /**
61
- * This defines the type of this shape
62
- */
63
- this.type = 'drawing.poly';
64
-
65
-
66
- /**
67
- * This facilitates easy object identification, and should always be true
68
- */
69
- this.isRGraph = true;
70
-
71
-
72
- /**
73
- * This adds a uid to the object that you can use for identification purposes
74
- */
75
- this.uid = RGraph.createUID();
76
-
77
-
78
- /**
79
- * This adds a UID to the canvas for identification purposes
80
- */
81
- this.canvas.uid = this.canvas.uid ? this.canvas.uid : RGraph.createUID();
82
-
83
-
84
-
85
-
86
- /**
87
- * Some example background properties
88
- */
89
- this.properties =
90
- {
91
- 'chart.linewidth': 1,
92
- 'chart.strokestyle': 'black',
93
- 'chart.fillstyle': 'red',
94
- 'chart.events.click': null,
95
- 'chart.events.mousemove': null,
96
- 'chart.tooltips': null,
97
- 'chart.tooltips.override': null,
98
- 'chart.tooltips.effect': 'fade',
99
- 'chart.tooltips.css.class': 'RGraph_tooltip',
100
- 'chart.tooltips.event': 'onclick',
101
- 'chart.tooltips.highlight': true,
102
- 'chart.highlight.stroke': 'rgba(0,0,0,0)',
103
- 'chart.highlight.fill': 'rgba(255,255,255,0.7)',
104
- 'chart.shadow': false,
105
- 'chart.shadow.color': 'rgba(0,0,0,0.2)',
106
- 'chart.shadow.offsetx': 3,
107
- 'chart.shadow.offsety': 3,
108
- 'chart.shadow.blur': 5,
109
- 'chart.clearto': 'rgba(0,0,0,0)'
110
- }
111
-
112
- /**
113
- * A simple check that the browser has canvas support
114
- */
115
- if (!this.canvas) {
116
- alert('[DRAWING.POLY] No canvas support');
117
- return;
118
- }
119
-
120
- /**
121
- * Create the dollar object so that functions can be added to them
122
- */
123
- this.$0 = {};
124
-
125
-
126
- /**
127
- * Translate half a pixel for antialiasing purposes - but only if it hasn't beeen
128
- * done already
129
- */
130
- if (!this.canvas.__rgraph_aa_translated__) {
131
- this.context.translate(0.5,0.5);
132
- this.canvas.__rgraph_aa_translated__ = true;
133
- }
134
-
135
-
136
-
137
-
138
- // Short variable names
139
- var RG = RGraph,
140
- ca = this.canvas,
141
- co = ca.getContext('2d'),
142
- prop = this.properties,
143
- pa2 = RG.path2,
144
- win = window,
145
- doc = document,
146
- ma = Math;
147
-
148
-
149
-
150
- /**
151
- * "Decorate" the object with the generic effects if the effects library has been included
152
- */
153
- if (RG.Effects && typeof RG.Effects.decorate === 'function') {
154
- RG.Effects.decorate(this);
155
- }
156
-
157
-
158
-
159
-
160
- /**
161
- * A setter method for setting properties.
162
- *
163
- * @param name string The name of the property to set OR it can be a map
164
- * of name/value settings like what you set in the constructor
165
- */
166
- this.set =
167
- this.Set = function (name)
168
- {
169
- var value = typeof arguments[1] === 'undefined' ? null : arguments[1];
170
-
171
- /**
172
- * the number of arguments is only one and it's an
173
- * object - parse it for configuration data and return.
174
- */
175
- if (arguments.length === 1 && typeof name === 'object') {
176
- RG.parseObjectStyleConfig(this, name);
177
- return this;
178
- }
179
-
180
-
181
-
182
-
183
-
184
- /**
185
- * This should be done first - prepend the property name with "chart." if necessary
186
- */
187
- if (name.substr(0,6) != 'chart.') {
188
- name = 'chart.' + name;
189
- }
190
-
191
-
192
-
193
-
194
- // Convert uppercase letters to dot+lower case letter
195
- while(name.match(/([A-Z])/)) {
196
- name = name.replace(/([A-Z])/, '.' + RegExp.$1.toLowerCase());
197
- }
198
-
199
-
200
-
201
-
202
-
203
-
204
- prop[name] = value;
205
-
206
- return this;
207
- };
208
-
209
-
210
-
211
-
212
- /**
213
- * A getter method for retrieving graph properties. It can be used like this: obj.Get('chart.strokestyle');
214
- *
215
- * @param name string The name of the property to get
216
- */
217
- this.get =
218
- this.Get = function (name)
219
- {
220
- /**
221
- * This should be done first - prepend the property name with "chart." if necessary
222
- */
223
- if (name.substr(0,6) != 'chart.') {
224
- name = 'chart.' + name;
225
- }
226
-
227
- // Convert uppercase letters to dot+lower case letter
228
- while(name.match(/([A-Z])/)) {
229
- name = name.replace(/([A-Z])/, '.' + RegExp.$1.toLowerCase());
230
- }
231
-
232
- return prop[name.toLowerCase()];
233
- };
234
-
235
-
236
-
237
-
238
- /**
239
- * Draws the shape
240
- */
241
- this.draw =
242
- this.Draw = function ()
243
- {
244
- /**
245
- * Fire the onbeforedraw event
246
- */
247
- RG.fireCustomEvent(this, 'onbeforedraw');
248
-
249
-
250
- /**
251
- * Parse the colors. This allows for simple gradient syntax
252
- */
253
- if (!this.colorsParsed) {
254
-
255
- this.parseColors();
256
-
257
- // Don't want to do this again
258
- this.colorsParsed = true;
259
- }
260
-
261
-
262
-
263
-
264
-
265
- /**
266
- * Stop this growing uncntrollably
267
- */
268
- this.coordsText = [];
269
-
270
-
271
-
272
-
273
-
274
- /**
275
- * DRAW THE SHAPE HERE
276
- */
277
-
278
- var obj = this;
279
- pa2(co, ['b','fu',function (obj){
280
- if (prop['chart.shadow']) {
281
- co.shadowColor = prop['chart.shadow.color'];
282
- co.shadowOffsetX = prop['chart.shadow.offsetx'];
283
- co.shadowOffsetY = prop['chart.shadow.offsety'];
284
- co.shadowBlur = prop['chart.shadow.blur'];
285
- }},'fu',function (obj)
286
- {
287
- co.strokeStyle = prop['chart.strokestyle'];
288
- co.fillStyle = prop['chart.fillstyle'];
289
-
290
- obj.drawPoly();
291
- },'lw',prop['chart.linewidth'],'f',prop['chart.fillstyle'], 'fu', function ()
292
- {
293
- RG.noShadow(obj);
294
- }, 's',prop['chart.strokestyle']]);
295
-
296
-
297
-
298
- /**
299
- * Turn off shadow again
300
- */
301
- RG.noShadow(this)
302
-
303
-
304
-
305
- /**
306
- * This installs the event listeners
307
- */
308
- RG.installEventListeners(this);
309
-
310
-
311
- /**
312
- * Fire the onfirstdraw event
313
- */
314
- if (this.firstDraw) {
315
- RG.fireCustomEvent(this, 'onfirstdraw');
316
- this.firstDraw = false;
317
- this.firstDrawFunc();
318
- }
319
-
320
-
321
-
322
-
323
- /**
324
- * Fire the ondraw event
325
- */
326
- RG.fireCustomEvent(this, 'ondraw');
327
-
328
- return this;
329
- };
330
-
331
-
332
-
333
- /**
334
- * Used in chaining. Runs a function there and then - not waiting for
335
- * the events to fire (eg the onbeforedraw event)
336
- *
337
- * @param function func The function to execute
338
- */
339
- this.exec = function (func)
340
- {
341
- func(this);
342
-
343
- return this;
344
- };
345
-
346
-
347
-
348
-
349
- /**
350
- * The getObjectByXY() worker method
351
- */
352
- this.getObjectByXY = function (e)
353
- {
354
- if (this.getShape(e)) {
355
- return this;
356
- }
357
- };
358
-
359
-
360
-
361
-
362
- /**
363
- * Draw the Poly but doesn't stroke or fill - that's left to other functions
364
- */
365
- this.drawPoly =
366
- this.DrawPoly = function ()
367
- {
368
- var coords = this.coords;
369
-
370
- pa2(co, ['b','m',coords[0][0], coords[0][1]]);
371
-
372
- // Draw lines to subsequent coords
373
- for (var i=1,len=coords.length; i<len; ++i) {
374
- co.lineTo(coords[i][0],coords[i][1]);
375
- }
376
-
377
- // Close the path and stroke/fill it with whatever the current fill/stroke styles are
378
- pa2(co, ['lw', prop['chart.linewidth'], 'c','f',co.fillStyle, 's',co.strokeStyle]);
379
- };
380
-
381
-
382
-
383
-
384
- /**
385
- * Not used by the class during creating the graph, but is used by event handlers
386
- * to get the coordinates (if any) of the selected bar
387
- *
388
- * @param object e The event object
389
- */
390
- this.getShape = function (e)
391
- {
392
- var coords = this.coords,
393
- mouseXY = RG.getMouseXY(e),
394
- mouseX = mouseXY[0],
395
- mouseY = mouseXY[1];
396
-
397
- // Should redraw the poly but not stroke or fill it and then use isPointInPath() to test it
398
- // DON'T USE PATH OBJECT HERE
399
- co.beginPath();
400
- co.strokeStyle = 'rgba(0,0,0,0)';
401
- co.fillStyle = 'rgba(0,0,0,0)';
402
- this.drawPoly();
403
-
404
- if (co.isPointInPath(mouseX, mouseY)) {
405
-
406
- return {
407
- 0: this, 1: this.coords, 2: 0,
408
- 'object': this, 'coords': this.coords, 'index': 0, 'tooltip': prop['chart.tooltips'] ? prop['chart.tooltips'][0] : null
409
- };
410
- }
411
-
412
- return null;
413
- };
414
-
415
-
416
-
417
-
418
- /**
419
- * Each object type has its own Highlight() function which highlights the appropriate shape
420
- *
421
- * @param object shape The shape to highlight
422
- */
423
- this.highlight =
424
- this.Highlight = function (shape)
425
- {
426
- // Evidentally this is necessary
427
- co.fillStyle = prop['chart.fillstyle'];
428
-
429
- // Add the new highlight
430
- if (prop['chart.tooltips.highlight']) {
431
- if (typeof prop['chart.highlight.style'] === 'function') {
432
- (prop['chart.highlight.style'])(shape);
433
- } else {
434
- pa2(co, ['b', 'fu', function (obj){obj.DrawPoly();},'f',prop['chart.highlight.fill'],'s',prop['chart.highlight.stroke']]);
435
- }
436
- }
437
- };
438
-
439
-
440
-
441
-
442
- /**
443
- * This allows for easy specification of gradients
444
- */
445
- this.parseColors = function ()
446
- {
447
-
448
- // Save the original colors so that they can be restored when the canvas is reset
449
- if (this.original_colors.length === 0) {
450
- this.original_colors['chart.fillstyle'] = RG.array_clone(prop['chart.fillstyle']);
451
- this.original_colors['chart.strokestyle'] = RG.array_clone(prop['chart.strokestyle']);
452
- this.original_colors['chart.highlight.stroke'] = RG.array_clone(prop['chart.highlight.stroke']);
453
- this.original_colors['chart.highlight.fill'] = RG.array_clone(prop['chart.highlight.fill']);
454
- }
455
-
456
- var func = this.parseSingleColorForGradient;
457
-
458
- /**
459
- * Parse various properties for colors
460
- */
461
- prop['chart.fillstyle'] = func(prop['chart.fillstyle']);
462
- prop['chart.strokestyle'] = func(prop['chart.strokestyle']);
463
- prop['chart.highlight.stroke'] = func(prop['chart.highlight.stroke']);
464
- prop['chart.highlight.fill'] = func(prop['chart.highlight.fill']);
465
- };
466
-
467
-
468
-
469
-
470
- /**
471
- * Use this function to reset the object to the post-constructor state. Eg reset colors if
472
- * need be etc
473
- */
474
- this.reset = function ()
475
- {
476
- };
477
-
478
-
479
-
480
-
481
- /**
482
- * This parses a single color value
483
- */
484
- this.parseSingleColorForGradient = function (color)
485
- {
486
- if (!color) {
487
- return color;
488
- }
489
-
490
- if (typeof color === 'string' && color.match(/^gradient\((.*)\)$/i)) {
491
-
492
- // Create the gradient
493
- var parts = RegExp.$1.split(':'),
494
- grad = co.createLinearGradient(0,0,ca.width,0),
495
- diff = 1 / (parts.length - 1);
496
-
497
- grad.addColorStop(0, RG.trim(parts[0]));
498
-
499
- for (var j=1,len=parts.length; j<len; ++j) {
500
- grad.addColorStop(j * diff, RG.trim(parts[j]));
501
- }
502
- }
503
-
504
- return grad ? grad : color;
505
- };
506
-
507
-
508
-
509
-
510
- /**
511
- * Using a function to add events makes it easier to facilitate method chaining
512
- *
513
- * @param string type The type of even to add
514
- * @param function func
515
- */
516
- this.on = function (type, func)
517
- {
518
- if (type.substr(0,2) !== 'on') {
519
- type = 'on' + type;
520
- }
521
-
522
- if (typeof this[type] !== 'function') {
523
- this[type] = func;
524
- } else {
525
- RG.addCustomEventListener(this, type, func);
526
- }
527
-
528
- return this;
529
- };
530
-
531
-
532
-
533
-
534
- /**
535
- * This function runs once only
536
- * (put at the end of the file (before any effects))
537
- */
538
- this.firstDrawFunc = function ()
539
- {
540
- };
541
-
542
-
543
-
544
-
545
- /**
546
- * Objects are now always registered so that the chart is redrawn if need be.
547
- */
548
- RG.register(this);
549
-
550
-
551
-
552
-
553
- /**
554
- * This is the 'end' of the constructor so if the first argument
555
- * contains configuration data - handle that.
556
- */
557
- if (parseConfObjectForOptions) {
558
- RG.parseObjectStyleConfig(this, conf.options);
559
- }
560
- };
2
+ RGraph=window.RGraph||{isRGraph:true};RGraph.Drawing=RGraph.Drawing||{};RGraph.Drawing.Poly=function(conf)
3
+ {if(typeof conf==='object'&&typeof conf.coords==='object'&&typeof conf.id==='string'){var id=conf.id,coords=conf.coords,parseConfObjectForOptions=true;}else{var id=conf,coords=arguments[1];}
4
+ this.id=id;this.canvas=document.getElementById(this.id);this.context=this.canvas.getContext('2d');this.colorsParsed=false;this.canvas.__object__=this;this.coords=coords;this.coordsText=[];this.original_colors=[];this.firstDraw=true;this.type='drawing.poly';this.isRGraph=true;this.uid=RGraph.createUID();this.canvas.uid=this.canvas.uid?this.canvas.uid:RGraph.createUID();this.properties={'chart.linewidth':1,'chart.strokestyle':'black','chart.fillstyle':'red','chart.events.click':null,'chart.events.mousemove':null,'chart.tooltips':null,'chart.tooltips.override':null,'chart.tooltips.effect':'fade','chart.tooltips.css.class':'RGraph_tooltip','chart.tooltips.event':'onclick','chart.tooltips.highlight':true,'chart.highlight.stroke':'rgba(0,0,0,0)','chart.highlight.fill':'rgba(255,255,255,0.7)','chart.shadow':false,'chart.shadow.color':'rgba(0,0,0,0.2)','chart.shadow.offsetx':3,'chart.shadow.offsety':3,'chart.shadow.blur':5,'chart.clearto':'rgba(0,0,0,0)'}
5
+ if(!this.canvas){alert('[DRAWING.POLY] No canvas support');return;}
6
+ 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
+ this.coordsText=[];var obj=this;pa2(co,['b','fu',function(obj){if(prop['chart.shadow']){co.shadowColor=prop['chart.shadow.color'];co.shadowOffsetX=prop['chart.shadow.offsetx'];co.shadowOffsetY=prop['chart.shadow.offsety'];co.shadowBlur=prop['chart.shadow.blur'];}},'fu',function(obj)
18
+ {co.strokeStyle=prop['chart.strokestyle'];co.fillStyle=prop['chart.fillstyle'];obj.drawPoly();},'lw',prop['chart.linewidth'],'f',prop['chart.fillstyle'],'fu',function()
19
+ {RG.noShadow(obj);},'s',prop['chart.strokestyle']]);RG.noShadow(this)
20
+ RG.installEventListeners(this);if(this.firstDraw){this.firstDraw=false;RG.fireCustomEvent(this,'onfirstdraw');this.firstDrawFunc();}
21
+ RG.fireCustomEvent(this,'ondraw');return this;};this.exec=function(func)
22
+ {func(this);return this;};this.getObjectByXY=function(e)
23
+ {if(this.getShape(e)){return this;}};this.drawPoly=this.DrawPoly=function()
24
+ {var coords=this.coords;pa2(co,['b','m',coords[0][0],coords[0][1]]);for(var i=1,len=coords.length;i<len;++i){co.lineTo(coords[i][0],coords[i][1]);}
25
+ pa2(co,['lw',prop['chart.linewidth'],'c','f',co.fillStyle,'s',co.strokeStyle]);};this.getShape=function(e)
26
+ {var coords=this.coords,mouseXY=RG.getMouseXY(e),mouseX=mouseXY[0],mouseY=mouseXY[1];co.beginPath();co.strokeStyle='rgba(0,0,0,0)';co.fillStyle='rgba(0,0,0,0)';this.drawPoly();if(co.isPointInPath(mouseX,mouseY)){return{0:this,1:this.coords,2:0,'object':this,'coords':this.coords,'index':0,'tooltip':prop['chart.tooltips']?prop['chart.tooltips'][0]:null};}
27
+ return null;};this.highlight=this.Highlight=function(shape)
28
+ {co.fillStyle=prop['chart.fillstyle'];if(prop['chart.tooltips.highlight']){if(typeof prop['chart.highlight.style']==='function'){(prop['chart.highlight.style'])(shape);}else{pa2(co,['b','fu',function(obj){obj.DrawPoly();},'f',prop['chart.highlight.fill'],'s',prop['chart.highlight.stroke']]);}}};this.parseColors=function()
29
+ {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']);}
30
+ var func=this.parseSingleColorForGradient;prop['chart.fillstyle']=func(prop['chart.fillstyle']);prop['chart.strokestyle']=func(prop['chart.strokestyle']);prop['chart.highlight.stroke']=func(prop['chart.highlight.stroke']);prop['chart.highlight.fill']=func(prop['chart.highlight.fill']);};this.reset=function()
31
+ {};this.parseSingleColorForGradient=function(color)
32
+ {if(!color){return color;}
33
+ if(typeof color==='string'&&color.match(/^gradient\((.*)\)$/i)){var parts=RegExp.$1.split(':'),grad=co.createLinearGradient(0,0,ca.width,0),diff=1/(parts.length-1);grad.addColorStop(0,RG.trim(parts[0]));for(var j=1,len=parts.length;j<len;++j){grad.addColorStop(j*diff,RG.trim(parts[j]));}}
34
+ return grad?grad:color;};this.on=function(type,func)
35
+ {if(type.substr(0,2)!=='on'){type='on'+type;}
36
+ if(typeof this[type]!=='function'){this[type]=func;}else{RG.addCustomEventListener(this,type,func);}
37
+ return this;};this.firstDrawFunc=function()
38
+ {};RG.register(this);if(parseConfObjectForOptions){RG.parseObjectStyleConfig(this,conf.options);}};