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