rgraph-rails 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +8 -8
  2. data/.travis.yml +0 -1
  3. data/README.md +3 -3
  4. data/lib/rgraph-rails/version.rb +1 -1
  5. data/vendor/assets/javascripts/RGraph.bar.js +239 -3764
  6. data/vendor/assets/javascripts/RGraph.bipolar.js +115 -1986
  7. data/vendor/assets/javascripts/RGraph.common.annotate.js +35 -399
  8. data/vendor/assets/javascripts/RGraph.common.context.js +30 -600
  9. data/vendor/assets/javascripts/RGraph.common.core.js +403 -5187
  10. data/vendor/assets/javascripts/RGraph.common.csv.js +19 -275
  11. data/vendor/assets/javascripts/RGraph.common.deprecated.js +35 -454
  12. data/vendor/assets/javascripts/RGraph.common.dynamic.js +84 -1189
  13. data/vendor/assets/javascripts/RGraph.common.effects.js +90 -1548
  14. data/vendor/assets/javascripts/RGraph.common.key.js +54 -755
  15. data/vendor/assets/javascripts/RGraph.common.resizing.js +37 -567
  16. data/vendor/assets/javascripts/RGraph.common.sheets.js +29 -356
  17. data/vendor/assets/javascripts/RGraph.common.tooltips.js +32 -614
  18. data/vendor/assets/javascripts/RGraph.common.zoom.js +14 -223
  19. data/vendor/assets/javascripts/RGraph.cornergauge.js +71 -0
  20. data/vendor/assets/javascripts/RGraph.drawing.background.js +35 -620
  21. data/vendor/assets/javascripts/RGraph.drawing.circle.js +35 -576
  22. data/vendor/assets/javascripts/RGraph.drawing.image.js +52 -807
  23. data/vendor/assets/javascripts/RGraph.drawing.marker1.js +41 -717
  24. data/vendor/assets/javascripts/RGraph.drawing.marker2.js +37 -668
  25. data/vendor/assets/javascripts/RGraph.drawing.marker3.js +36 -563
  26. data/vendor/assets/javascripts/RGraph.drawing.poly.js +40 -608
  27. data/vendor/assets/javascripts/RGraph.drawing.rect.js +35 -597
  28. data/vendor/assets/javascripts/RGraph.drawing.text.js +34 -642
  29. data/vendor/assets/javascripts/RGraph.drawing.xaxis.js +50 -809
  30. data/vendor/assets/javascripts/RGraph.drawing.yaxis.js +51 -856
  31. data/vendor/assets/javascripts/RGraph.fuel.js +58 -964
  32. data/vendor/assets/javascripts/RGraph.funnel.js +55 -984
  33. data/vendor/assets/javascripts/RGraph.gantt.js +75 -1241
  34. data/vendor/assets/javascripts/RGraph.gauge.js +87 -1397
  35. data/vendor/assets/javascripts/RGraph.hbar.js +143 -2376
  36. data/vendor/assets/javascripts/RGraph.hprogress.js +80 -1397
  37. data/vendor/assets/javascripts/RGraph.line.js +241 -4162
  38. data/vendor/assets/javascripts/RGraph.meter.js +74 -1278
  39. metadata +3 -30
  40. data/vendor/assets/images/bg.png +0 -0
  41. data/vendor/assets/images/bullet.png +0 -0
  42. data/vendor/assets/images/facebook-large.png +0 -0
  43. data/vendor/assets/images/google-plus-large.png +0 -0
  44. data/vendor/assets/images/logo.png +0 -0
  45. data/vendor/assets/images/meter-image-sd-needle.png +0 -0
  46. data/vendor/assets/images/meter-image-sd.png +0 -0
  47. data/vendor/assets/images/meter-sketch-needle.png +0 -0
  48. data/vendor/assets/images/meter-sketch.png +0 -0
  49. data/vendor/assets/images/odometer-background.png +0 -0
  50. data/vendor/assets/images/rgraph.jpg +0 -0
  51. data/vendor/assets/images/title.png +0 -0
  52. data/vendor/assets/images/twitter-large.png +0 -0
  53. data/vendor/assets/javascripts/RGraph.modaldialog.js +0 -301
  54. data/vendor/assets/javascripts/RGraph.odo.js +0 -1265
  55. data/vendor/assets/javascripts/RGraph.pie.js +0 -2272
  56. data/vendor/assets/javascripts/RGraph.radar.js +0 -1847
  57. data/vendor/assets/javascripts/RGraph.rose.js +0 -1877
  58. data/vendor/assets/javascripts/RGraph.rscatter.js +0 -1425
  59. data/vendor/assets/javascripts/RGraph.scatter.js +0 -2970
  60. data/vendor/assets/javascripts/RGraph.semicircularprogress.js +0 -1015
  61. data/vendor/assets/javascripts/RGraph.thermometer.js +0 -1129
  62. data/vendor/assets/javascripts/RGraph.vprogress.js +0 -1452
  63. data/vendor/assets/javascripts/RGraph.waterfall.js +0 -1252
  64. data/vendor/assets/javascripts/financial-data.js +0 -1067
  65. data/vendor/assets/stylesheets/ModalDialog.css +0 -90
  66. data/vendor/assets/stylesheets/animations.css +0 -3347
  67. data/vendor/assets/stylesheets/website.css +0 -446
@@ -1,598 +1,36 @@
1
- // version: 2016-06-04
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 dual licensed under the Open Source GPL (General Public License) |
9
- * | v2.0 license and a commercial license which means that you're not bound by |
10
- * | the terms of the GPL. The commercial license is just 99 GBP and you can |
11
- * | read about it here: |
12
- * | http://www.rgraph.net/license |
13
- * o--------------------------------------------------------------------------------o
14
- */
15
-
16
- /**
17
- * Having this here means that the RGraph libraries can be included in any order, instead of you having
18
- * to include the common core library first.
19
- */
20
1
 
21
- // Define the RGraph global variable
22
- RGraph = window.RGraph || {isRGraph: true};
23
- RGraph.Drawing = RGraph.Drawing || {};
24
-
25
- /**
26
- * The constructor. This function sets up the object. It takes the ID (the HTML attribute) of the canvas as the
27
- * first argument and the data as the second. If you need to change this, you can.
28
- *
29
- * @param string id The canvas tag ID
30
- * @param number x The X position of the rectangle
31
- * @param number y The Y position of the rectangle
32
- * @param number w The width of the rectangle
33
- * @param number h The height of the rectangle
34
- */
35
- RGraph.Drawing.Rect = function (conf)
36
- {
37
- /**
38
- * Allow for object config style
39
- */
40
- if ( typeof conf === 'object'
41
- && typeof conf.x === 'number'
42
- && typeof conf.y === 'number'
43
- && typeof conf.width === 'number'
44
- && typeof conf.height === 'number'
45
- && typeof conf.id === 'string') {
46
-
47
- var id = conf.id
48
- var x = conf.x;
49
- var y = conf.y;
50
- var width = conf.width;
51
- var height = conf.height;
52
-
53
- var parseConfObjectForOptions = true; // Set this so the config is parsed (at the end of the constructor)
54
-
55
- } else {
56
-
57
- var id = conf;
58
- var x = arguments[1];
59
- var y = arguments[2];
60
- var width = arguments[3];
61
- var height = arguments[4];
62
- }
63
-
64
-
65
-
66
-
67
- // id, x, y, w, h
68
- this.id = id;
69
- this.canvas = document.getElementById(this.id);
70
- this.context = this.canvas.getContext('2d');
71
- this.colorsParsed = false;
72
- this.canvas.__object__ = this;
73
- this.original_colors = [];
74
- this.coordsText = [];
75
- this.firstDraw = true; // After the first draw this will be false
76
-
77
- /**
78
- * This defines the type of this shape
79
- */
80
- this.type = 'drawing.rect';
81
-
82
-
83
- /**
84
- * This facilitates easy object identification, and should always be true
85
- */
86
- this.isRGraph = true;
87
-
88
-
89
- /**
90
- * This adds a uid to the object that you can use for identification purposes
91
- */
92
- this.uid = RGraph.CreateUID();
93
-
94
-
95
- /**
96
- * This adds a UID to the canvas for identification purposes
97
- */
98
- this.canvas.uid = this.canvas.uid ? this.canvas.uid : RGraph.CreateUID();
99
-
100
-
101
-
102
-
103
- /**
104
- * Some example background properties
105
- */
106
- this.properties =
107
- {
108
- 'chart.strokestyle': 'rgba(0,0,0,0)',
109
- 'chart.fillstyle': 'red',
110
- 'chart.events.click': null,
111
- 'chart.events.mousemove': null,
112
- 'chart.shadow': false,
113
- 'chart.shadow.color': 'gray',
114
- 'chart.shadow.offsetx': 3,
115
- 'chart.shadow.offsety': 3,
116
- 'chart.shadow.blur': 5,
117
- 'chart.highlight.stroke': 'black',
118
- 'chart.highlight.fill': 'rgba(255,255,255,0.7)',
119
- 'chart.tooltips': null,
120
- 'chart.tooltips.effect': 'fade',
121
- 'chart.tooltips.css.class':'RGraph_tooltip',
122
- 'chart.tooltips.event': 'onclick',
123
- 'chart.tooltips.highlight':true,
124
- 'chart.tooltips.coords.page': false,
125
- 'chart.tooltips.valign': 'top',
126
- 'chart.clearto': 'rgba(0,0,0,0)'
127
- }
128
-
129
- /**
130
- * A simple check that the browser has canvas support
131
- */
132
- if (!this.canvas) {
133
- alert('[DRAWING.RECT] No canvas support');
134
- return;
135
- }
136
-
137
- /**
138
- * This can be used to store the coordinates of shapes on the graph
139
- */
140
- this.coords = [[Math.round(x), Math.round(y), width, height]];
141
-
142
- /**
143
- * Create the dollar object so that functions can be added to them
144
- */
145
- this.$0 = {};
146
-
147
-
148
- /**
149
- * Translate half a pixel for antialiasing purposes - but only if it hasn't beeen
150
- * done already
151
- */
152
- if (!this.canvas.__rgraph_aa_translated__) {
153
- this.context.translate(0.5,0.5);
154
-
155
- this.canvas.__rgraph_aa_translated__ = true;
156
- }
157
-
158
-
159
-
160
- // Short variable names
161
- var RG = RGraph,
162
- ca = this.canvas,
163
- co = ca.getContext('2d'),
164
- prop = this.properties,
165
- pa2 = RG.path2,
166
- win = window,
167
- doc = document,
168
- ma = Math
169
-
170
-
171
-
172
- /**
173
- * "Decorate" the object with the generic effects if the effects library has been included
174
- */
175
- if (RG.Effects && typeof RG.Effects.decorate === 'function') {
176
- RG.Effects.decorate(this);
177
- }
178
-
179
-
180
-
181
-
182
- /**
183
- * A setter method for setting graph properties. It can be used like this: obj.Set('chart.strokestyle', '#666');
184
- *
185
- * @param name string The name of the property to set
186
- * @param value mixed The value of the property
187
- */
188
- this.set =
189
- this.Set = function (name)
190
- {
191
- var value = typeof arguments[1] === 'undefined' ? null : arguments[1];
192
-
193
- /**
194
- * the number of arguments is only one and it's an
195
- * object - parse it for configuration data and return.
196
- */
197
- if (arguments.length === 1 && typeof name === 'object') {
198
- RG.parseObjectStyleConfig(this, name);
199
- return this;
200
- }
201
-
202
-
203
-
204
-
205
-
206
- /**
207
- * This should be done first - prepend the propertyy name with "chart." if necessary
208
- */
209
- if (name.substr(0,6) != 'chart.') {
210
- name = 'chart.' + name;
211
- }
212
-
213
-
214
-
215
-
216
- // Convert uppercase letters to dot+lower case letter
217
- while(name.match(/([A-Z])/)) {
218
- name = name.replace(/([A-Z])/, '.' + RegExp.$1.toLowerCase());
219
- }
220
-
221
-
222
-
223
-
224
-
225
-
226
- prop[name] = value;
227
-
228
- return this;
229
- };
230
-
231
-
232
-
233
-
234
- /**
235
- * A getter method for retrieving graph properties. It can be used like this: obj.Get('chart.strokestyle');
236
- *
237
- * @param name string The name of the property to get
238
- */
239
- this.get =
240
- this.Get = function (name)
241
- {
242
- /**
243
- * This should be done first - prepend the property name with "chart." if necessary
244
- */
245
- if (name.substr(0,6) != 'chart.') {
246
- name = 'chart.' + name;
247
- }
248
-
249
- // Convert uppercase letters to dot+lower case letter
250
- name = name.replace(/([A-Z])/g, function (str)
251
- {
252
- return '.' + String(RegExp.$1).toLowerCase()
253
- });
254
-
255
- return prop[name.toLowerCase()];
256
- };
257
-
258
-
259
-
260
-
261
- /**
262
- * Draws the rectangle
263
- */
264
- this.draw =
265
- this.Draw = function ()
266
- {
267
- /**
268
- * Fire the onbeforedraw event
269
- */
270
- RG.FireCustomEvent(this, 'onbeforedraw');
271
-
272
-
273
-
274
-
275
- /**
276
- * Stop this growing uncntrollably
277
- */
278
- this.coordsText = [];
279
-
280
-
281
-
282
-
283
- /**
284
- * Parse the colors. This allows for simple gradient syntax
285
- */
286
- if (!this.colorsParsed) {
287
-
288
- this.parseColors();
289
-
290
- // Don't want to do this again
291
- this.colorsParsed = true;
292
- }
293
-
294
-
295
- /**
296
- * Draw the rect here
297
- */
298
- pa2(co, ['b']);
299
-
300
- if (prop['chart.shadow']) {
301
- pa2(co, ['sc',prop['chart.shadow.color'],'sx',prop['chart.shadow.offsetx'],'sy',prop['chart.shadow.offsety'],'sb',prop['chart.shadow.blur']]);
302
- }
303
-
304
- pa2(co, ['r',this.coords[0][0], this.coords[0][1], this.coords[0][2], this.coords[0][3],'f',prop['chart.fillstyle']]);
305
-
306
-
307
- // No shaadow to stroke the rectangle
308
- RG.NoShadow(this);
309
-
310
- pa2(co, ['s',prop['chart.strokestyle']]);
311
-
312
-
313
- /**
314
- * This installs the event listeners
315
- */
316
- RG.InstallEventListeners(this);
317
-
318
-
319
- /**
320
- * Fire the onfirstdraw event
321
- */
322
- if (this.firstDraw) {
323
- RG.fireCustomEvent(this, 'onfirstdraw');
324
- this.firstDraw = false;
325
- this.firstDrawFunc();
326
- }
327
-
328
-
329
-
330
-
331
- /**
332
- * Fire the ondraw event
333
- */
334
- RG.FireCustomEvent(this, 'ondraw');
335
-
336
- return this;
337
- };
338
-
339
-
340
-
341
- /**
342
- * Used in chaining. Runs a function there and then - not waiting for
343
- * the events to fire (eg the onbeforedraw event)
344
- *
345
- * @param function func The function to execute
346
- */
347
- this.exec = function (func)
348
- {
349
- func(this);
350
-
351
- return this;
352
- };
353
-
354
-
355
-
356
-
357
- /**
358
- * The getObjectByXY() worker method
359
- */
360
- this.getObjectByXY = function (e)
361
- {
362
- if (this.getShape(e)) {
363
- return this;
364
- }
365
- };
366
-
367
-
368
-
369
-
370
- /**
371
- * Not used by the class during creating the graph, but is used by event handlers
372
- * to get the coordinates (if any) of the selected bar
373
- *
374
- * @param object e The event object
375
- * @param object OPTIONAL You can pass in the bar object instead of the
376
- * function using "this"
377
- */
378
- this.getShape = function (e)
379
- {
380
- var mouseXY = RGraph.getMouseXY(e);
381
- var mouseX = mouseXY[0];
382
- var mouseY = mouseXY[1];
383
-
384
- for (var i=0,len=this.coords.length; i<len; i++) {
385
-
386
- var coords = this.coords[i];
387
-
388
- var left = coords[0];
389
- var top = coords[1];
390
- var width = coords[2];
391
- var height = coords[3];
392
-
393
- if (mouseX >= left && mouseX <= (left + width) && mouseY >= top && mouseY <= (top + height)) {
394
-
395
- return {
396
- 0: this, 1: left, 2: top, 3: width, 4: height, 5: 0,
397
- 'object': this, 'x': left, 'y': top, 'width': width, 'height': height, 'index': 0, 'tooltip': prop['chart.tooltips'] ? prop['chart.tooltips'][0] : null
398
- };
399
- }
400
- }
401
-
402
- return null;
403
- };
404
-
405
-
406
-
407
-
408
- /**
409
- * This function positions a tooltip when it is displayed
410
- *
411
- * @param obj object The chart object
412
- * @param int x The X coordinate specified for the tooltip
413
- * @param int y The Y coordinate specified for the tooltip
414
- * @param objec tooltip The tooltips DIV element
415
- */
416
- this.positionTooltip = function (obj, x, y, tooltip, idx)
417
- {
418
- var coordX = obj.coords[0][0];
419
- var coordY = obj.coords[0][1];
420
- var coordW = obj.coords[0][2];
421
- var coordH = obj.coords[0][3];
422
- var canvasXY = RG.getCanvasXY(obj.canvas);
423
- var mouseXY = RG.getMouseXY(window.event);
424
- var width = tooltip.offsetWidth;
425
- var height = tooltip.offsetHeight;
426
-
427
- // Set the top position
428
- tooltip.style.left = 0;
429
-
430
- if (prop['chart.tooltips.valign'] == 'center') {
431
- tooltip.style.top = canvasXY[1] + coordY + (coordH / 2) -height + 'px';
432
- } else {
433
- tooltip.style.top = window.event.pageY - height - 5 + 'px';
434
- }
435
-
436
- // Set the top position
437
- tooltip.style.left = 0;
438
-
439
- // By default any overflow is hidden
440
- tooltip.style.overflow = '';
441
-
442
- // Reposition the tooltip if at the edges:
443
-
444
- // LEFT edge
445
- if (canvasXY[0] + mouseXY[0] - (width / 2) < 0) {
446
- tooltip.style.left = canvasXY[0] + mouseXY[0] - (width * 0.1) + 'px';
447
-
448
- // RIGHT edge
449
- } else if (canvasXY[0] + mouseXY[0] + (width / 2) > doc.body.offsetWidth) {
450
- tooltip.style.left = canvasXY[0] + mouseXY[0] - (width * 0.9) + 'px';
451
-
452
- // Default positioning - CENTERED
453
- } else {
454
- tooltip.style.left = canvasXY[0] + mouseXY[0] - (width / 2) + 'px';
455
- }
456
- };
457
-
458
-
459
-
460
-
461
- /**
462
- * Each object type has its own Highlight() function which highlights the appropriate shape
463
- *
464
- * @param object shape The shape to highlight
465
- */
466
- this.highlight =
467
- this.Highlight = function (shape)
468
- {
469
- if (typeof prop['chart.highlight.style'] === 'function') {
470
- (prop['chart.highlight.style'])(shape);
471
- } else {
472
- RG.Highlight.Rect(this, shape);
473
- }
474
- };
475
-
476
-
477
-
478
-
479
- /**
480
- * This allows for easy specification of gradients
481
- */
482
- this.parseColors = function ()
483
- {
484
- // Save the original colors so that they can be restored when the canvas is reset
485
- if (this.original_colors.length === 0) {
486
- this.original_colors['chart.fillstyle'] = RG.array_clone(prop['chart.fillstyle']);
487
- this.original_colors['chart.strokestyle'] = RG.array_clone(prop['chart.strokestyle']);
488
- this.original_colors['chart.highlight.stroke'] = RG.array_clone(prop['chart.highlight.stroke']);
489
- this.original_colors['chart.highlight.fill'] = RG.array_clone(prop['chart.highlight.fill']);
490
- }
491
-
492
-
493
-
494
-
495
- /**
496
- * Parse various properties for colors
497
- */
498
- prop['chart.fillstyle'] = this.parseSingleColorForGradient(prop['chart.fillstyle']);
499
- prop['chart.strokestyle'] = this.parseSingleColorForGradient(prop['chart.strokestyle']);
500
- prop['chart.highlight.stroke'] = this.parseSingleColorForGradient(prop['chart.highlight.stroke']);
501
- prop['chart.highlight.fill'] = this.parseSingleColorForGradient(prop['chart.highlight.fill']);
502
- };
503
-
504
-
505
-
506
-
507
- /**
508
- * Use this function to reset the object to the post-constructor state. Eg reset colors if
509
- * need be etc
510
- */
511
- this.reset = function ()
512
- {
513
- };
514
-
515
-
516
-
517
-
518
- /**
519
- * This parses a single color value
520
- */
521
- this.parseSingleColorForGradient = function (color)
522
- {
523
- if (!color) {
524
- return color;
525
- }
526
-
527
- if (typeof color === 'string' && color.match(/^gradient\((.*)\)$/i)) {
528
-
529
- var parts = RegExp.$1.split(':');
530
-
531
- // Create the gradient
532
- var grad = co.createLinearGradient(0,0,ca.width,0);
533
-
534
- var diff = 1 / (parts.length - 1);
535
-
536
- grad.addColorStop(0, RG.trim(parts[0]));
537
-
538
- for (var j=1,len=parts.length; j<len; ++j) {
539
- grad.addColorStop(j * diff, RG.trim(parts[j]));
540
- }
541
- }
542
-
543
- return grad ? grad : color;
544
- };
545
-
546
-
547
-
548
-
549
- /**
550
- * Using a function to add events makes it easier to facilitate method chaining
551
- *
552
- * @param string type The type of even to add
553
- * @param function func
554
- */
555
- this.on = function (type, func)
556
- {
557
- if (type.substr(0,2) !== 'on') {
558
- type = 'on' + type;
559
- }
560
-
561
- this[type] = func;
562
-
563
- return this;
564
- };
565
-
566
-
567
-
568
-
569
- /**
570
- * This function runs once only
571
- * (put at the end of the file (before any effects))
572
- */
573
- this.firstDrawFunc = function ()
574
- {
575
- };
576
-
577
-
578
-
579
-
580
- RG.att(ca);
581
-
582
-
583
- /**
584
- * Objects are now always registered so that the chart is redrawn if need be.
585
- */
586
- RG.Register(this);
587
-
588
-
589
-
590
-
591
- /**
592
- * This is the 'end' of the constructor so if the first argument
593
- * contains configuration data - handle that.
594
- */
595
- if (parseConfObjectForOptions) {
596
- RG.parseObjectStyleConfig(this, conf.options);
597
- }
598
- };
2
+ RGraph=window.RGraph||{isRGraph:true};RGraph.Drawing=RGraph.Drawing||{};RGraph.Drawing.Rect=function(conf)
3
+ {if(typeof conf==='object'&&typeof conf.x==='number'&&typeof conf.y==='number'&&typeof conf.width==='number'&&typeof conf.height==='number'&&typeof conf.id==='string'){var id=conf.id
4
+ var x=conf.x;var y=conf.y;var width=conf.width;var height=conf.height;var parseConfObjectForOptions=true;}else{var id=conf;var x=arguments[1];var y=arguments[2];var width=arguments[3];var height=arguments[4];}
5
+ this.id=id;this.canvas=document.getElementById(this.id);this.context=this.canvas.getContext('2d');this.colorsParsed=false;this.canvas.__object__=this;this.original_colors=[];this.coordsText=[];this.firstDraw=true;this.type='drawing.rect';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.effect':'fade','chart.tooltips.css.class':'RGraph_tooltip','chart.tooltips.event':'onclick','chart.tooltips.highlight':true,'chart.tooltips.coords.page':false,'chart.tooltips.valign':'top','chart.clearto':'rgba(0,0,0,0)'}
6
+ if(!this.canvas){alert('[DRAWING.RECT] No canvas support');return;}
7
+ this.coords=[[Math.round(x),Math.round(y),width,height]];this.$0={};if(!this.canvas.__rgraph_aa_translated__){this.context.translate(0.5,0.5);this.canvas.__rgraph_aa_translated__=true;}
8
+ var RG=RGraph,ca=this.canvas,co=ca.getContext('2d'),prop=this.properties,pa2=RG.path2,win=window,doc=document,ma=Math
9
+ if(RG.Effects&&typeof RG.Effects.decorate==='function'){RG.Effects.decorate(this);}
10
+ this.set=this.Set=function(name)
11
+ {var value=typeof arguments[1]==='undefined'?null:arguments[1];if(arguments.length===1&&typeof name==='object'){RG.parseObjectStyleConfig(this,name);return this;}
12
+ if(name.substr(0,6)!='chart.'){name='chart.'+name;}
13
+ while(name.match(/([A-Z])/)){name=name.replace(/([A-Z])/,'.'+RegExp.$1.toLowerCase());}
14
+ prop[name]=value;return this;};this.get=this.Get=function(name)
15
+ {if(name.substr(0,6)!='chart.'){name='chart.'+name;}
16
+ while(name.match(/([A-Z])/)){name=name.replace(/([A-Z])/,'.'+RegExp.$1.toLowerCase());}
17
+ return prop[name.toLowerCase()];};this.draw=this.Draw=function()
18
+ {RG.FireCustomEvent(this,'onbeforedraw');this.coordsText=[];if(!this.colorsParsed){this.parseColors();this.colorsParsed=true;}
19
+ pa2(co,['b']);if(prop['chart.shadow']){pa2(co,['sc',prop['chart.shadow.color'],'sx',prop['chart.shadow.offsetx'],'sy',prop['chart.shadow.offsety'],'sb',prop['chart.shadow.blur']]);}
20
+ pa2(co,['r',this.coords[0][0],this.coords[0][1],this.coords[0][2],this.coords[0][3],'f',prop['chart.fillstyle']]);RG.NoShadow(this);pa2(co,['s',prop['chart.strokestyle']]);RG.InstallEventListeners(this);if(this.firstDraw){RG.fireCustomEvent(this,'onfirstdraw');this.firstDraw=false;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.getShape=function(e)
24
+ {var mouseXY=RGraph.getMouseXY(e);var mouseX=mouseXY[0];var mouseY=mouseXY[1];for(var i=0,len=this.coords.length;i<len;i++){var coords=this.coords[i];var left=coords[0];var top=coords[1];var width=coords[2];var height=coords[3];if(mouseX>=left&&mouseX<=(left+width)&&mouseY>=top&&mouseY<=(top+height)){return{0:this,1:left,2:top,3:width,4:height,5:0,'object':this,'x':left,'y':top,'width':width,'height':height,'index':0,'tooltip':prop['chart.tooltips']?prop['chart.tooltips'][0]:null};}}
25
+ return null;};this.highlight=this.Highlight=function(shape)
26
+ {if(typeof prop['chart.highlight.style']==='function'){(prop['chart.highlight.style'])(shape);}else{RG.Highlight.Rect(this,shape);}};this.parseColors=function()
27
+ {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']);}
28
+ 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()
29
+ {};this.parseSingleColorForGradient=function(color)
30
+ {if(!color){return color;}
31
+ if(typeof color==='string'&&color.match(/^gradient\((.*)\)$/i)){var parts=RegExp.$1.split(':');var grad=co.createLinearGradient(0,0,ca.width,0);var 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]));}}
32
+ return grad?grad:color;};this.on=function(type,func)
33
+ {if(type.substr(0,2)!=='on'){type='on'+type;}
34
+ if(typeof this[type]!=='function'){this[type]=func;}else{RG.addCustomEventListener(this,type,func);}
35
+ return this;};this.firstDrawFunc=function()
36
+ {};RG.att(ca);RG.Register(this);if(parseConfObjectForOptions){RG.parseObjectStyleConfig(this,conf.options);}};