rgraph-rails 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +8 -8
  2. data/.travis.yml +1 -0
  3. data/README.md +2 -2
  4. data/lib/rgraph-rails/version.rb +1 -1
  5. data/vendor/assets/images/bullet.png +0 -0
  6. data/vendor/assets/images/facebook-large.png +0 -0
  7. data/vendor/assets/images/google-plus-large.png +0 -0
  8. data/vendor/assets/images/logo.png +0 -0
  9. data/vendor/assets/images/rgraph.jpg +0 -0
  10. data/vendor/assets/javascripts/RGraph.bar.js +533 -242
  11. data/vendor/assets/javascripts/RGraph.bipolar.js +152 -169
  12. data/vendor/assets/javascripts/RGraph.common.annotate.js +2 -2
  13. data/vendor/assets/javascripts/RGraph.common.context.js +2 -2
  14. data/vendor/assets/javascripts/RGraph.common.core.js +688 -373
  15. data/vendor/assets/javascripts/RGraph.common.csv.js +2 -2
  16. data/vendor/assets/javascripts/RGraph.common.deprecated.js +2 -2
  17. data/vendor/assets/javascripts/RGraph.common.dynamic.js +188 -193
  18. data/vendor/assets/javascripts/RGraph.common.effects.js +62 -38
  19. data/vendor/assets/javascripts/RGraph.common.key.js +35 -15
  20. data/vendor/assets/javascripts/RGraph.common.resizing.js +38 -21
  21. data/vendor/assets/javascripts/RGraph.common.sheets.js +2 -2
  22. data/vendor/assets/javascripts/RGraph.common.tooltips.js +48 -40
  23. data/vendor/assets/javascripts/RGraph.common.zoom.js +2 -2
  24. data/vendor/assets/javascripts/RGraph.drawing.background.js +33 -49
  25. data/vendor/assets/javascripts/RGraph.drawing.circle.js +27 -30
  26. data/vendor/assets/javascripts/RGraph.drawing.image.js +23 -26
  27. data/vendor/assets/javascripts/RGraph.drawing.marker1.js +47 -40
  28. data/vendor/assets/javascripts/RGraph.drawing.marker2.js +38 -42
  29. data/vendor/assets/javascripts/RGraph.drawing.marker3.js +24 -28
  30. data/vendor/assets/javascripts/RGraph.drawing.poly.js +25 -39
  31. data/vendor/assets/javascripts/RGraph.drawing.rect.js +27 -32
  32. data/vendor/assets/javascripts/RGraph.drawing.text.js +53 -58
  33. data/vendor/assets/javascripts/RGraph.drawing.xaxis.js +24 -29
  34. data/vendor/assets/javascripts/RGraph.drawing.yaxis.js +45 -51
  35. data/vendor/assets/javascripts/RGraph.fuel.js +11 -9
  36. data/vendor/assets/javascripts/RGraph.funnel.js +40 -43
  37. data/vendor/assets/javascripts/RGraph.gantt.js +34 -34
  38. data/vendor/assets/javascripts/RGraph.gauge.js +64 -55
  39. data/vendor/assets/javascripts/RGraph.hbar.js +194 -137
  40. data/vendor/assets/javascripts/RGraph.hprogress.js +261 -167
  41. data/vendor/assets/javascripts/RGraph.line.js +520 -512
  42. data/vendor/assets/javascripts/RGraph.meter.js +11 -10
  43. data/vendor/assets/javascripts/RGraph.modaldialog.js +11 -2
  44. data/vendor/assets/javascripts/RGraph.odo.js +11 -9
  45. data/vendor/assets/javascripts/RGraph.pie.js +385 -100
  46. data/vendor/assets/javascripts/RGraph.radar.js +36 -29
  47. data/vendor/assets/javascripts/RGraph.rose.js +58 -41
  48. data/vendor/assets/javascripts/RGraph.rscatter.js +40 -36
  49. data/vendor/assets/javascripts/RGraph.scatter.js +441 -499
  50. data/vendor/assets/javascripts/RGraph.semicircularprogress.js +1015 -0
  51. data/vendor/assets/javascripts/RGraph.thermometer.js +37 -37
  52. data/vendor/assets/javascripts/RGraph.vprogress.js +285 -157
  53. data/vendor/assets/javascripts/RGraph.waterfall.js +62 -62
  54. data/vendor/assets/stylesheets/website.css +30 -16
  55. metadata +3 -2
@@ -1,4 +1,4 @@
1
- // version: 2016-02-06
1
+ // version: 2016-06-04
2
2
  /**
3
3
  * o--------------------------------------------------------------------------------o
4
4
  * | This file is part of the RGraph package - you can learn more at: |
@@ -7,7 +7,7 @@
7
7
  * | |
8
8
  * | RGraph is dual licensed under the Open Source GPL (General Public License) |
9
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 starts at just 99 (GBP) and |
10
+ * | the terms of the GPL. The commercial license starts at just 99 GBP and |
11
11
  * | you can read about it here: |
12
12
  * | |
13
13
  * | http://www.rgraph.net/license |
@@ -1,4 +1,4 @@
1
- // version: 2016-02-06
1
+ // version: 2016-06-04
2
2
  /**
3
3
  * o--------------------------------------------------------------------------------o
4
4
  * | This file is part of the RGraph package - you can learn more at: |
@@ -7,7 +7,7 @@
7
7
  * | |
8
8
  * | RGraph is dual licensed under the Open Source GPL (General Public License) |
9
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 starts at just 99 (GBP) and |
10
+ * | the terms of the GPL. The commercial license starts at just 99 GBP and |
11
11
  * | you can read about it here: |
12
12
  * | |
13
13
  * | http://www.rgraph.net/license |
@@ -120,8 +120,10 @@
120
120
 
121
121
  'chart.text.color': 'black', // Gradients aren't supported for this color
122
122
  'chart.text.size': 12,
123
- 'chart.text.font': 'Arial',
124
-
123
+ 'chart.text.font': 'Segoe UI, Arial, Verdana, sans-serif',
124
+ 'chart.text.accessible': true,
125
+ 'chart.text.accessible.overflow': 'visible',
126
+ 'chart.text.accessible.pointerevents': false,
125
127
  'chart.events.click': null,
126
128
  'chart.events.mousemove': null,
127
129
 
@@ -163,6 +165,7 @@
163
165
  'chart.title.yaxis.x': null,
164
166
  'chart.title.yaxis.y': null,
165
167
  'chart.title.yaxis.pos': null,
168
+ 'chart.clearto': 'rgba(0,0,0,0)'
166
169
  }
167
170
 
168
171
  /**
@@ -252,10 +255,9 @@
252
255
 
253
256
 
254
257
  // Convert uppercase letters to dot+lower case letter
255
- name = name.replace(/([A-Z])/g, function (str)
256
- {
257
- return '.' + String(RegExp.$1).toLowerCase();
258
- });
258
+ while(name.match(/([A-Z])/)) {
259
+ name = name.replace(/([A-Z])/, '.' + RegExp.$1.toLowerCase());
260
+ }
259
261
 
260
262
 
261
263
  prop[name] = value;
@@ -437,52 +439,29 @@
437
439
  var height = tooltip.offsetHeight;
438
440
  var tooltipX = RG.getCanvasXY(obj.canvas)[0] + ((obj.canvas.width - this.gutterLeft - this.gutterRight) / 2) + this.gutterLeft;
439
441
  var tooltipY = RG.getCanvasXY(obj.canvas)[1] + ((obj.canvas.height - this.gutterTop - this.gutterBottom) / 2) + this.gutterTop;
442
+ var mouseXY = RG.getMouseXY(window.event);
440
443
 
441
444
  // Set the top position
442
445
  tooltip.style.left = 0;
443
- tooltip.style.top = tooltipY - height - 7 + 'px';
444
-
446
+ tooltip.style.top = window.event.pageY - height - 5 + 'px';
447
+
445
448
  // By default any overflow is hidden
446
449
  tooltip.style.overflow = '';
447
-
448
- // The arrow
449
- var img = new Image();
450
- img.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAFCAYAAACjKgd3AAAARUlEQVQYV2NkQAN79+797+RkhC4M5+/bd47B2dmZEVkBCgcmgcsgbAaA9GA1BCSBbhAuA/AagmwQPgMIGgIzCD0M0AMMAEFVIAa6UQgcAAAAAElFTkSuQmCC';
451
- img.style.position = 'absolute';
452
- img.id = '__rgraph_tooltip_pointer__';
453
- img.style.top = (tooltip.offsetHeight - 2) + 'px';
454
- tooltip.appendChild(img);
455
450
 
456
451
  // Reposition the tooltip if at the edges:
457
452
 
458
453
  // LEFT edge
459
- if ( (tooltipX - (width / 2)) < 10) {
460
- tooltip.style.left = (tooltipX - (width * 0.1)) + 'px';
461
- img.style.left = ((width * 0.1) - 8.5) + 'px';
462
-
463
- // RIGHT EDGE
464
- } else if ( (tooltipX + (width / 2)) > doc.body.offsetWidth) {
465
- tooltip.style.left = (tooltipX - (width * 0.9)) + 'px';
466
- img.style.left = ((width * 0.9) - 8.5) + 'px';
467
-
468
-
469
- // CENTERED
470
- } else {
471
- tooltip.style.left = (tooltipX - (width * 0.5)) + 'px';
472
- img.style.left = ((width * 0.5) - 8.5) + 'px';
473
- }
474
- //tooltip.style.left = (canvasXY[0] + this.centerx - (width * 0.1)) + 'px';
475
- //img.style.left = ((width * 0.1) - 8.5) + 'px';
476
-
454
+ if (canvasXY[0] + mouseXY[0] - (width / 2) < 0) {
455
+ tooltip.style.left = canvasXY[0] + mouseXY[0] - (width * 0.1) + 'px';
456
+
477
457
  // RIGHT edge
478
- //} else if ((canvasXY[0] + obj.canvas.width + (width / 2)) > doc.body.offsetWidth) {
479
- // tooltip.style.left = canvasXY[0] + this.centerx - (width * 0.9) + 'px';
480
- // img.style.left = ((width * 0.9) - 8.5) + 'px';
481
-
458
+ } else if (canvasXY[0] + mouseXY[0] + (width / 2) > doc.body.offsetWidth) {
459
+ tooltip.style.left = canvasXY[0] + mouseXY[0] - (width * 0.9) + 'px';
460
+
482
461
  // Default positioning - CENTERED
483
- //} else {
484
- // tooltip.style.left = (canvasXY[0] + obj.gutterLeft ((obj.canvas.width - obj.gutterLeft - obj.gutterRight) / 2) - (width * 0.5)) + 'px';
485
- // img.style.left = ((width * 0.5) - 8.5) + 'px';
462
+ } else {
463
+ tooltip.style.left = canvasXY[0] + mouseXY[0] - (width / 2) + 'px';
464
+ }
486
465
  };
487
466
 
488
467
 
@@ -497,12 +476,17 @@
497
476
  this.Highlight = function (shape)
498
477
  {
499
478
  if (prop['chart.tooltips.highlight']) {
500
- pa(co, ['b',
501
- 'r', prop['chart.gutter.left'],
502
- prop['chart.gutter.top'],
503
- ca.width - prop['chart.gutter.left'] - prop['chart.gutter.right'],
504
- ca.height - prop['chart.gutter.top'] - prop['chart.gutter.bottom'],
505
- 'f',prop['chart.highlight.fill'],'s',prop['chart.highlight.stroke']]);
479
+ if (typeof prop['chart.highlight.style'] === 'function') {
480
+ (prop['chart.highlight.style'])(shape);
481
+ } else {
482
+ pa2(co, [
483
+ 'b',
484
+ 'r', prop['chart.gutter.left'], prop['chart.gutter.top'], ca.width - prop['chart.gutter.left'] - prop['chart.gutter.right'],ca.height - prop['chart.gutter.top'] - prop['chart.gutter.bottom'],
485
+ 'f',prop['chart.highlight.fill'],
486
+ 's',prop['chart.highlight.stroke']
487
+ ]);
488
+
489
+ }
506
490
  }
507
491
  };
508
492
 
@@ -1,4 +1,4 @@
1
- // version: 2016-02-06
1
+ // version: 2016-06-04
2
2
  /**
3
3
  * o--------------------------------------------------------------------------------o
4
4
  * | This file is part of the RGraph package - you can learn more at: |
@@ -7,7 +7,7 @@
7
7
  * | |
8
8
  * | RGraph is dual licensed under the Open Source GPL (General Public License) |
9
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 starts at just 99 (GBP) and |
10
+ * | the terms of the GPL. The commercial license starts at just 99 GBP and |
11
11
  * | you can read about it here: |
12
12
  * | |
13
13
  * | http://www.rgraph.net/license |
@@ -123,7 +123,8 @@
123
123
  'chart.tooltips': null,
124
124
  'chart.tooltips.highlight': true,
125
125
  'chart.tooltips.event': 'onclick',
126
- 'chart.linewidth': 2
126
+ 'chart.linewidth': 2,
127
+ 'chart.clearto': 'rgba(0,0,0,0)'
127
128
  }
128
129
 
129
130
  /**
@@ -165,7 +166,6 @@
165
166
  ca = this.canvas,
166
167
  co = ca.getContext('2d'),
167
168
  prop = this.properties,
168
- pa = RG.Path,
169
169
  pa2 = RG.path2,
170
170
  win = window,
171
171
  doc = document,
@@ -218,10 +218,9 @@
218
218
 
219
219
 
220
220
  // Convert uppercase letters to dot+lower case letter
221
- name = name.replace(/([A-Z])/g, function (str)
222
- {
223
- return '.' + String(RegExp.$1).toLowerCase();
224
- });
221
+ while(name.match(/([A-Z])/)) {
222
+ name = name.replace(/([A-Z])/, '.' + RegExp.$1.toLowerCase());
223
+ }
225
224
 
226
225
 
227
226
 
@@ -286,13 +285,13 @@
286
285
  this.colorsParsed = true;
287
286
  }
288
287
 
289
- pa(co, ['b', 'lw',prop['chart.linewidth']]);
288
+ pa2(co, ['b', 'lw',prop['chart.linewidth']]);
290
289
 
291
290
  if (prop['chart.shadow']) {
292
291
  RG.SetShadow(this, prop['chart.shadow.color'], prop['chart.shadow.offsetx'], prop['chart.shadow.offsety'], prop['chart.shadow.blur']);
293
292
  }
294
293
 
295
- pa(co, ['a',this.coords[0][0], this.coords[0][1], this.radius, 0, RGraph.TWOPI, false,'f',prop['chart.fillstyle'],'s', prop['chart.strokestyle']]);
294
+ pa2(co, ['a',this.coords[0][0], this.coords[0][1], this.radius, 0, RGraph.TWOPI, false,'f',prop['chart.fillstyle'],'s', prop['chart.strokestyle']]);
296
295
 
297
296
  // Must turn the shadow off before the fill is done
298
297
  RG.NoShadow(this);
@@ -388,7 +387,7 @@
388
387
  * @param obj object The chart object
389
388
  * @param int x The X coordinate specified for the tooltip
390
389
  * @param int y The Y coordinate specified for the tooltip
391
- * @param objec tooltip The tooltips DIV element
390
+ * @param object tooltip The tooltips DIV element
392
391
  */
393
392
  this.positionTooltip = function (obj, x, y, tooltip, idx)
394
393
  {
@@ -396,38 +395,32 @@
396
395
  var width = tooltip.offsetWidth;
397
396
  var height = tooltip.offsetHeight;
398
397
  var radius = this.radius;
398
+ var mouseXY = RG.getMouseXY(window.event);
399
399
 
400
400
  // Set the top position
401
401
  tooltip.style.left = 0;
402
- tooltip.style.top = canvasXY[1] + obj.centery - height - 7 + 'px';
403
-
402
+ tooltip.style.top = canvasXY[1] + this.coords[0][1] - (height / 2) - this.radius + 'px';
403
+
404
+ // Set the top position
405
+ tooltip.style.left = 0;
406
+ tooltip.style.top = window.event.pageY - height - 5 + 'px';
407
+
404
408
  // By default any overflow is hidden
405
409
  tooltip.style.overflow = '';
406
-
407
- // The arrow
408
- var img = new Image();
409
- img.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAFCAYAAACjKgd3AAAARUlEQVQYV2NkQAN79+797+RkhC4M5+/bd47B2dmZEVkBCgcmgcsgbAaA9GA1BCSBbhAuA/AagmwQPgMIGgIzCD0M0AMMAEFVIAa6UQgcAAAAAElFTkSuQmCC';
410
- img.style.position = 'absolute';
411
- img.id = '__rgraph_tooltip_pointer__';
412
- img.style.top = (tooltip.offsetHeight - 2) + 'px';
413
- tooltip.appendChild(img);
414
410
 
415
411
  // Reposition the tooltip if at the edges:
416
412
 
417
413
  // LEFT edge
418
- if ((canvasXY[0] + obj.centerx - (width / 2)) < 10) {
419
- tooltip.style.left = (canvasXY[0] + this.centerx - (width * 0.1)) + 'px';
420
- img.style.left = ((width * 0.1) - 8.5) + 'px';
414
+ if (canvasXY[0] + mouseXY[0] - (width / 2) < 0) {
415
+ tooltip.style.left = canvasXY[0] + mouseXY[0] - (width * 0.1) + 'px';
421
416
 
422
417
  // RIGHT edge
423
- } else if ((canvasXY[0] + obj.centerx + (width / 2)) > doc.body.offsetWidth) {
424
- tooltip.style.left = canvasXY[0] + this.centerx - (width * 0.9) + 'px';
425
- img.style.left = ((width * 0.9) - 8.5) + 'px';
418
+ } else if (canvasXY[0] + mouseXY[0] + (width / 2) > doc.body.offsetWidth) {
419
+ tooltip.style.left = canvasXY[0] + mouseXY[0] - (width * 0.9) + 'px';
426
420
 
427
421
  // Default positioning - CENTERED
428
422
  } else {
429
- tooltip.style.left = (canvasXY[0] + this.centerx - (width * 0.5)) + 'px';
430
- img.style.left = ((width * 0.5) - 8.5) + 'px';
423
+ tooltip.style.left = canvasXY[0] + mouseXY[0] - (width / 2) + 'px';
431
424
  }
432
425
  };
433
426
 
@@ -443,7 +436,11 @@
443
436
  this.Highlight = function (shape)
444
437
  {
445
438
  if (prop['chart.tooltips.highlight']) {
446
- pa(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']]);
439
+ if (typeof prop['chart.highlight.style'] === 'function') {
440
+ (prop['chart.highlight.style'])(shape);
441
+ } else {
442
+ 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']]);
443
+ }
447
444
  }
448
445
  };
449
446
 
@@ -1,4 +1,4 @@
1
- // version: 2016-02-06
1
+ // version: 2016-06-04
2
2
  /**
3
3
  * o--------------------------------------------------------------------------------o
4
4
  * | This file is part of the RGraph package - you can learn more at: |
@@ -7,7 +7,7 @@
7
7
  * | |
8
8
  * | RGraph is dual licensed under the Open Source GPL (General Public License) |
9
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 starts at just 99 (GBP) and |
10
+ * | the terms of the GPL. The commercial license starts at just 99 GBP and |
11
11
  * | you can read about it here: |
12
12
  * | |
13
13
  * | http://www.rgraph.net/license |
@@ -138,7 +138,8 @@
138
138
  'chart.border.color': 'black',
139
139
  'chart.border.linewidth': 1,
140
140
  'chart.border.radius': 0,
141
- 'chart.background.color': 'rgba(0,0,0,0)'
141
+ 'chart.background.color': 'rgba(0,0,0,0)',
142
+ 'chart.clearto': 'rgba(0,0,0,0)'
142
143
  }
143
144
 
144
145
  /**
@@ -179,7 +180,6 @@
179
180
  ca = this.canvas,
180
181
  co = ca.getContext('2d'),
181
182
  prop = this.properties,
182
- pa = RG.Path,
183
183
  pa2 = RG.path2,
184
184
  win = window,
185
185
  doc = document,
@@ -232,10 +232,9 @@
232
232
 
233
233
 
234
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
- });
235
+ while(name.match(/([A-Z])/)) {
236
+ name = name.replace(/([A-Z])/, '.' + RegExp.$1.toLowerCase());
237
+ }
239
238
 
240
239
 
241
240
 
@@ -588,38 +587,32 @@
588
587
  var canvasXY = RG.getCanvasXY(obj.canvas);
589
588
  var width = tooltip.offsetWidth;
590
589
  var height = tooltip.offsetHeight;
590
+ var mouseXY = RG.getMouseXY(window.event);
591
+
592
+ // Set the top position
593
+ tooltip.style.left = 0;
594
+ tooltip.style.top = canvasXY[1] + this.coords[0][1] - (height / 2) - this.radius + 'px';
591
595
 
592
596
  // Set the top position
593
597
  tooltip.style.left = 0;
594
- tooltip.style.top = canvasXY[1] - height - 7 + this.coords[0][1] + (obj.coords[0][3] / 2) + 'px';
598
+ tooltip.style.top = window.event.pageY - height - 5 + 'px';
595
599
 
596
600
  // By default any overflow is hidden
597
601
  tooltip.style.overflow = '';
598
-
599
- // The arrow
600
- var img = new Image();
601
- img.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAFCAYAAACjKgd3AAAARUlEQVQYV2NkQAN79+797+RkhC4M5+/bd47B2dmZEVkBCgcmgcsgbAaA9GA1BCSBbhAuA/AagmwQPgMIGgIzCD0M0AMMAEFVIAa6UQgcAAAAAElFTkSuQmCC';
602
- img.style.position = 'absolute';
603
- img.id = '__rgraph_tooltip_pointer__';
604
- img.style.top = (tooltip.offsetHeight - 2) + 'px';
605
- tooltip.appendChild(img);
606
602
 
607
603
  // Reposition the tooltip if at the edges:
608
604
 
609
605
  // LEFT edge
610
- if ((canvasXY[0] + obj.coords[0][0] + (obj.coords[0][2] / 2) - (width / 2)) < 10) {
611
- tooltip.style.left = (canvasXY[0] + this.coords[0][0] + (this.coords[0][2] / 2) - (width * 0.1)) + 'px';
612
- img.style.left = ((width * 0.1) - 8.5) + 'px';
606
+ if (canvasXY[0] + mouseXY[0] - (width / 2) < 0) {
607
+ tooltip.style.left = canvasXY[0] + mouseXY[0] - (width * 0.1) + 'px';
613
608
 
614
609
  // RIGHT edge
615
- } else if ((canvasXY[0] + this.coords[0][0] + (this.coords[0][2] / 2) + (width / 2)) > doc.body.offsetWidth) {
616
- tooltip.style.left = (canvasXY[0] + this.coords[0][0] + (this.coords[0][2] / 2) - (width * 0.9)) + 'px';
617
- img.style.left = ((width * 0.9) - 8.5) + 'px';
610
+ } else if (canvasXY[0] + mouseXY[0] + (width / 2) > doc.body.offsetWidth) {
611
+ tooltip.style.left = canvasXY[0] + mouseXY[0] - (width * 0.9) + 'px';
618
612
 
619
613
  // Default positioning - CENTERED
620
614
  } else {
621
- tooltip.style.left = (canvasXY[0] + this.coords[0][0] + (this.coords[0][2] / 2) - (width * 0.5)) + 'px';
622
- img.style.left = ((width * 0.5) - 8.5) + 'px';
615
+ tooltip.style.left = canvasXY[0] + mouseXY[0] - (width / 2) + 'px';
623
616
  }
624
617
  };
625
618
 
@@ -635,7 +628,11 @@
635
628
  this.Highlight = function (shape)
636
629
  {
637
630
  if (prop['chart.tooltips.highlight']) {
638
- pa(co, ['b','r',this.coords[0][0],this.coords[0][1],this.coords[0][2],this.coords[0][3], 'f',prop['chart.highlight.fill'], 's', prop['chart.highlight.stroke']]);
631
+ if (typeof prop['chart.highlight.style'] === 'function') {
632
+ (prop['chart.highlight.style'])(shape);
633
+ } else {
634
+ pa2(co, ['b','r',this.coords[0][0],this.coords[0][1],this.coords[0][2],this.coords[0][3], 'f',prop['chart.highlight.fill'], 's', prop['chart.highlight.stroke']]);
635
+ }
639
636
  }
640
637
  };
641
638
 
@@ -1,4 +1,4 @@
1
- // version: 2016-02-06
1
+ // version: 2016-06-04
2
2
  /**
3
3
  * o--------------------------------------------------------------------------------o
4
4
  * | This file is part of the RGraph package - you can learn more at: |
@@ -7,7 +7,7 @@
7
7
  * | |
8
8
  * | RGraph is dual licensed under the Open Source GPL (General Public License) |
9
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 starts at just 99 (GBP) and |
10
+ * | the terms of the GPL. The commercial license starts at just 99 GBP and |
11
11
  * | you can read about it here: |
12
12
  * | |
13
13
  * | http://www.rgraph.net/license |
@@ -119,7 +119,10 @@
119
119
  'chart.linewidth': 2,
120
120
  'chart.text.color': 'black',
121
121
  'chart.text.size': 12,
122
- 'chart.text.font': 'Arial',
122
+ 'chart.text.font': 'Segoe UI, Arial, Verdana, sans-serif',
123
+ 'chart.text.accessible': true,
124
+ 'chart.text.accessible.overflow': 'visible',
125
+ 'chart.text.accessible.pointerevents': false,
123
126
  'chart.events.click': null,
124
127
  'chart.events.mousemove': null,
125
128
  'chart.shadow': true,
@@ -132,7 +135,8 @@
132
135
  'chart.tooltips': null,
133
136
  'chart.tooltips.highlight': true,
134
137
  'chart.tooltips.event': 'onclick',
135
- 'chart.align': 'center'
138
+ 'chart.align': 'center',
139
+ 'chart.clearto': 'rgba(0,0,0,0)'
136
140
  }
137
141
 
138
142
  /**
@@ -177,7 +181,6 @@
177
181
  ca = this.canvas,
178
182
  co = ca.getContext('2d'),
179
183
  prop = this.properties,
180
- pa = RG.Path,
181
184
  pa2 = RG.path2,
182
185
  win = window,
183
186
  doc = document,
@@ -230,10 +233,9 @@
230
233
 
231
234
 
232
235
  // Convert uppercase letters to dot+lower case letter
233
- name = name.replace(/([A-Z])/g, function (str)
234
- {
235
- return '.' + String(RegExp.$1).toLowerCase();
236
- });
236
+ while(name.match(/([A-Z])/)) {
237
+ name = name.replace(/([A-Z])/, '.' + RegExp.$1.toLowerCase());
238
+ }
237
239
 
238
240
 
239
241
 
@@ -328,14 +330,14 @@
328
330
  /**
329
331
  * DRAW THE MARKER HERE
330
332
  */
331
- pa(co, ['b','lw',prop['chart.linewidth']]);
333
+ pa2(co, ['b','lw',prop['chart.linewidth']]);
332
334
 
333
335
  if (prop['chart.shadow']) {
334
336
  RG.SetShadow(this, prop['chart.shadow.color'], prop['chart.shadow.offsetx'], prop['chart.shadow.offsety'], prop['chart.shadow.blur']);
335
337
  }
336
338
  this.DrawMarker();
337
339
 
338
- pa(co, ['c','s',prop['chart.strokestyle'],'f',prop['chart.fillstyle']]);
340
+ pa2(co, ['c','s',prop['chart.strokestyle'],'f',prop['chart.fillstyle']]);
339
341
 
340
342
 
341
343
 
@@ -463,6 +465,7 @@
463
465
  this.positionTooltip = function (obj, x, y, tooltip, idx)
464
466
  {
465
467
  var canvasXY = RG.getCanvasXY(obj.canvas);
468
+ var mouseXY = RG.getMouseXY(window.event);
466
469
  var width = tooltip.offsetWidth;
467
470
  var height = tooltip.offsetHeight;
468
471
 
@@ -470,33 +473,26 @@
470
473
  tooltip.style.left = 0;
471
474
  tooltip.style.top = canvasXY[1] + this.coords[0][1] - (height / 2) - this.radius + 'px';
472
475
 
476
+ // Set the top position
477
+ tooltip.style.left = 0;
478
+ tooltip.style.top = window.event.pageY - height - 5 + 'px';
479
+
473
480
  // By default any overflow is hidden
474
481
  tooltip.style.overflow = '';
475
-
476
- // The arrow
477
- var img = new Image();
478
- img.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAFCAYAAACjKgd3AAAARUlEQVQYV2NkQAN79+797+RkhC4M5+/bd47B2dmZEVkBCgcmgcsgbAaA9GA1BCSBbhAuA/AagmwQPgMIGgIzCD0M0AMMAEFVIAa6UQgcAAAAAElFTkSuQmCC';
479
- img.style.position = 'absolute';
480
- img.id = '__rgraph_tooltip_pointer__';
481
- img.style.top = (tooltip.offsetHeight - 2) + 'px';
482
- tooltip.appendChild(img);
483
482
 
484
483
  // Reposition the tooltip if at the edges:
485
484
 
486
485
  // LEFT edge
487
- if ((canvasXY[0] + obj.coords[0][0] + (obj.coords[0][2] / 2) - (width / 2)) < 10) {
488
- tooltip.style.left = canvasXY[0] + this.markerCenterx - (width * 0.1) + 'px';
489
- img.style.left = ((width * 0.1) - 8.5) + 'px';
486
+ if (canvasXY[0] + mouseXY[0] - (width / 2) < 0) {
487
+ tooltip.style.left = canvasXY[0] + mouseXY[0] - (width * 0.1) + 'px';
490
488
 
491
489
  // RIGHT edge
492
- } else if ((canvasXY[0] + this.coords[0][0] + (this.coords[0][2] / 2) + (width / 2)) > doc.body.offsetWidth) {
493
- tooltip.style.left = canvasXY[0] + this.markerCenterx - (width * 0.9) + 'px';
494
- img.style.left = ((width * 0.9) - 8.5) + 'px';
490
+ } else if (canvasXY[0] + mouseXY[0] + (width / 2) > doc.body.offsetWidth) {
491
+ tooltip.style.left = canvasXY[0] + mouseXY[0] - (width * 0.9) + 'px';
495
492
 
496
493
  // Default positioning - CENTERED
497
494
  } else {
498
- tooltip.style.left = (canvasXY[0] + this.markerCenterx - (width * 0.5)) + 'px';
499
- img.style.left = ((width * 0.5) - 8.5) + 'px';
495
+ tooltip.style.left = canvasXY[0] + mouseXY[0] - (width / 2) + 'px';
500
496
  }
501
497
  };
502
498
 
@@ -512,7 +508,18 @@
512
508
  this.Highlight = function (shape)
513
509
  {
514
510
  if (prop['chart.tooltips.highlight']) {
515
- pa(this, ['b','fu',function (obj){obj.DrawMarker();},'c','s',prop['chart.highlight.stroke'],'f',prop['chart.highlight.fill']]);
511
+ if (typeof prop['chart.highlight.style'] === 'function') {
512
+ (prop['chart.highlight.style'])(shape);
513
+ } else {
514
+
515
+ co.beginPath();
516
+ co.strokeStyle = prop['chart.highlight.stroke'];
517
+ co.fillStyle = prop['chart.highlight.fill'];
518
+ this.drawMarker();
519
+ co.closePath();
520
+ co.stroke();
521
+ co.fill();
522
+ }
516
523
  }
517
524
  };
518
525
 
@@ -533,32 +540,32 @@
533
540
  var x = this.markerCenterx;
534
541
  var y = this.markerCentery;
535
542
 
536
- pa(co, ['a',x,y,r,RG.HALFPI,RG.TWOPI,false]);
543
+ pa2(co, ['a',x,y,r,RG.HALFPI,RG.TWOPI,false]);
537
544
 
538
545
  // special case for MSIE 7/8
539
546
  if (RG.ISOLD) {
540
- pa(co,['m',x + r + r,y+r+r,'qc',x + r,y + r,x + r + 1,y,'m',x + r + r,y+r+r]);
547
+ pa2(co,['m',x + r + r,y+r+r,'qc',x + r,y + r,x + r + 1,y,'m',x + r + r,y+r+r]);
541
548
  } else {
542
- pa(co, ['qc',x + r,y + r,x + r + r,y + r + r]);
549
+ pa2(co, ['qc',x + r,y + r,x + r + r,y + r + r]);
543
550
  }
544
551
 
545
- pa(co, ['qc',x + r,y + r,x,y + r + (RG.ISOLD ? 1 : 0)]);
552
+ pa2(co, ['qc',x + r,y + r,x,y + r + (RG.ISOLD ? 1 : 0)]);
546
553
 
547
554
  } else if (prop['chart.align'] == 'right') {
548
555
 
549
556
  var x = this.markerCenterx;
550
557
  var y = this.markerCentery;
551
558
 
552
- pa(co, ['a',x,y,r,RG.HALFPI,RG.PI,true]);
559
+ pa2(co, ['a',x,y,r,RG.HALFPI,RG.PI,true]);
553
560
 
554
561
  // special case for MSIE 7/8
555
562
  if (RG.ISOLD) {
556
- pa(co, ['m',x - r - r,y+r+r,'qc',x - r,y + r,x - r - 1,y,'m',x - r - r,y+r+r]);
563
+ pa2(co, ['m',x - r - r,y+r+r,'qc',x - r,y + r,x - r - 1,y,'m',x - r - r,y+r+r]);
557
564
  } else {
558
- pa(co, ['qc',x - r,y + r,x - r - r,y + r + r]);
565
+ pa2(co, ['qc',x - r,y + r,x - r - r,y + r + r]);
559
566
  }
560
567
 
561
- pa(co, ['qc',x - r, y + r, x, y + r + (RG.ISOLD ? 1 : 0)]);
568
+ pa2(co, ['qc',x - r, y + r, x, y + r + (RG.ISOLD ? 1 : 0)]);
562
569
 
563
570
  // Default is center
564
571
  } else {
@@ -566,17 +573,17 @@
566
573
  var x = this.markerCenterx;
567
574
  var y = this.markerCentery;
568
575
 
569
- pa(co, ['a',x, y, r, RG.HALFPI / 2, RG.PI - (RG.HALFPI / 2), true]);
576
+ pa2(co, ['a',x, y, r, RG.HALFPI / 2, RG.PI - (RG.HALFPI / 2), true]);
570
577
  //co.arc(x, y, r, HALFPI / 2, PI - (HALFPI / 2), true);
571
578
 
572
579
  // special case for MSIE 7/8
573
580
  if (RG.ISOLD) {
574
- pa(co, ['m',x,y+r+r-2,'qc',x,y + r + (r / 4),x - (Math.cos(RG.HALFPI / 2) * r),y + (Math.sin(RG.HALFPI / 2) * r),'m',x, y+r+r-2]);
581
+ pa2(co, ['m',x,y+r+r-2,'qc',x,y + r + (r / 4),x - (Math.cos(RG.HALFPI / 2) * r),y + (Math.sin(RG.HALFPI / 2) * r),'m',x, y+r+r-2]);
575
582
  } else {
576
- pa(co, ['qc',x,y + r + (r / 4),x,y + r + r - 2]);
583
+ pa2(co, ['qc',x,y + r + (r / 4),x,y + r + r - 2]);
577
584
  }
578
585
 
579
- pa(co, ['qc',x,y + r + (r / 4),x + (Math.cos(RG.HALFPI / 2) * r),y + (Math.sin(RG.HALFPI / 2) * r)]);
586
+ pa2(co, ['qc',x,y + r + (r / 4),x + (Math.cos(RG.HALFPI / 2) * r),y + (Math.sin(RG.HALFPI / 2) * r)]);
580
587
  }
581
588
 
582
589
  this.coords[0] = [x, y, r];