rgraph-rails 1.0.4 → 1.0.5

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 (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 |
@@ -75,7 +75,11 @@
75
75
  //RGraph.OldBrowserCompat(this.context);
76
76
 
77
77
 
78
- // The left and right data respectively
78
+ // The left and right data respectively. Ensure that the data is an array
79
+ // of numbers
80
+ for (var i=0; i<left.length; ++i) left[i] = parseFloat(left[i]);
81
+ for (var i=0; i<right.length; ++i) right[i] = parseFloat(right[i]);
82
+
79
83
  this.left = left;
80
84
  this.right = right;
81
85
  this.data = [left, right];
@@ -96,7 +100,10 @@
96
100
  'chart.labels.above': false,
97
101
  'chart.text.size': 12,
98
102
  'chart.text.color': 'black', // (Simple) gradients are not supported
99
- 'chart.text.font': 'Arial',
103
+ 'chart.text.font': 'Segoe UI, Arial, Verdana, sans-serif',
104
+ 'chart.text.accessible': true,
105
+ 'chart.text.accessible.overflow': 'visible',
106
+ 'chart.text.accessible.pointerevents': false,
100
107
  'chart.title.left': '',
101
108
  'chart.title.right': '',
102
109
  'chart.gutter.center': 60,
@@ -135,7 +142,7 @@
135
142
  'chart.annotate.color': 'black',
136
143
  'chart.xmax': null,
137
144
  'chart.xmin': 0,
138
- 'chart.scale.zerostart': false,
145
+ 'chart.scale.zerostart': true,
139
146
  'chart.scale.decimals': null,
140
147
  'chart.scale.point': '.',
141
148
  'chart.scale.thousand': ',',
@@ -164,7 +171,8 @@
164
171
  'chart.labels.count': 5,
165
172
  'chart.variant.threed.offsetx': 10,
166
173
  'chart.variant.threed.offsety': 5,
167
- 'chart.variant.threed.angle': 0.1
174
+ 'chart.variant.threed.angle': 0.1,
175
+ 'chart.clearto': 'rgba(0,0,0,0)'
168
176
  }
169
177
 
170
178
  // Pad the arrays so they're the same size
@@ -207,7 +215,6 @@
207
215
  ca = this.canvas,
208
216
  co = ca.getContext('2d'),
209
217
  prop = this.properties,
210
- pa = RG.Path,
211
218
  pa2 = RG.path2,
212
219
  win = window,
213
220
  doc = document,
@@ -264,10 +271,9 @@
264
271
 
265
272
 
266
273
  // Convert uppercase letters to dot+lower case letter
267
- name = name.replace(/([A-Z])/g, function (str)
268
- {
269
- return '.' + String(RegExp.$1).toLowerCase();
270
- });
274
+ while(name.match(/([A-Z])/)) {
275
+ name = name.replace(/([A-Z])/, '.' + RegExp.$1.toLowerCase());
276
+ }
271
277
 
272
278
 
273
279
 
@@ -363,8 +369,11 @@
363
369
 
364
370
 
365
371
  if (prop['chart.variant'] === '3d') {
366
- co.setTransform(1,prop['chart.variant.threed.angle'],0,1,0.5,0.5);
367
-
372
+ if (prop['chart.text.accessible']) {
373
+ // Nada
374
+ } else {
375
+ co.setTransform(1,prop['chart.variant.threed.angle'],0,1,0.5,0.5);
376
+ }
368
377
  }
369
378
 
370
379
 
@@ -481,15 +490,13 @@
481
490
 
482
491
  // Draw the horizontal 3d axis
483
492
  // The left horizontal axis
484
- pa(co, [
485
- 'b',
486
- 'm', this.gutterLeft, ma.round( ca.height - this.gutterBottom),
487
- 'l', this.gutterLeft + offsetx, ma.round( ca.height - this.gutterBottom - offsety),
488
- 'l', this.gutterLeft + offsetx + this.axisWidth, ma.round( ca.height - this.gutterBottom - offsety),
489
- 'l', this.gutterLeft + this.axisWidth, ma.round( ca.height - this.gutterBottom),
490
- 's', '#aaa',
491
- 'f','#ddd'
492
- ]);
493
+ pa2(co,
494
+ 'b m % % l % % l % % l % % s #aaa f #ddd',
495
+ this.gutterLeft, ma.round( ca.height - this.gutterBottom),
496
+ this.gutterLeft + offsetx, ma.round( ca.height - this.gutterBottom - offsety),
497
+ this.gutterLeft + offsetx + this.axisWidth, ma.round( ca.height - this.gutterBottom - offsety),
498
+ this.gutterLeft + this.axisWidth, ma.round( ca.height - this.gutterBottom)
499
+ );
493
500
 
494
501
  // The left vertical axis
495
502
  this.draw3DLeftVerticalAxis();
@@ -498,29 +505,25 @@
498
505
 
499
506
 
500
507
  // Draw the right horizontal axes
501
- pa(co, [
502
- 'b',
503
- 'm', this.gutterLeft + this.gutterCenter + this.axisWidth, ma.round( ca.height - this.gutterBottom),
504
- 'l',this.gutterLeft + this.gutterCenter + this.axisWidth + offsetx, ma.round( ca.height - this.gutterBottom - offsety),
505
- 'l',this.gutterLeft + this.gutterCenter + this.axisWidth + this.axisWidth + offsetx, ma.round( ca.height - this.gutterBottom - offsety),
506
- 'l',this.gutterLeft + this.gutterCenter + this.axisWidth + this.axisWidth, ma.round( ca.height - this.gutterBottom),
507
- 's', '#aaa',
508
- 'f','#ddd'
509
- ]);
508
+ pa2(co,
509
+ 'b m % % l % % l % % l % % s #aaa f #ddd',
510
+ this.gutterLeft + this.gutterCenter + this.axisWidth, ma.round( ca.height - this.gutterBottom),
511
+ this.gutterLeft + this.gutterCenter + this.axisWidth + offsetx, ma.round( ca.height - this.gutterBottom - offsety),
512
+ this.gutterLeft + this.gutterCenter + this.axisWidth + this.axisWidth + offsetx, ma.round( ca.height - this.gutterBottom - offsety),
513
+ this.gutterLeft + this.gutterCenter + this.axisWidth + this.axisWidth, ma.round( ca.height - this.gutterBottom)
514
+ );
510
515
 
511
516
 
512
517
 
513
518
 
514
519
  // Draw the right vertical axes
515
- pa(co, [
516
- 'b',
517
- 'm', this.gutterLeft + this.gutterCenter + this.axisWidth, ca.height - this.gutterBottom,
518
- 'l', this.gutterLeft + this.gutterCenter + this.axisWidth, ca.height - this.gutterBottom - this.axisHeight,
519
- 'l',this.gutterLeft + this.gutterCenter + this.axisWidth + offsetx, ca.height - this.gutterBottom - this.axisHeight - offsety,
520
- 'l',this.gutterLeft + this.gutterCenter + this.axisWidth + offsetx, ca.height - this.gutterBottom - offsety,
521
- 's', '#aaa',
522
- 'f','#ddd'
523
- ]);
520
+ pa2(co,
521
+ 'b m % % l % % l % % l % % s #aaa f #ddd',
522
+ this.gutterLeft + this.gutterCenter + this.axisWidth, ca.height - this.gutterBottom,
523
+ this.gutterLeft + this.gutterCenter + this.axisWidth, ca.height - this.gutterBottom - this.axisHeight,
524
+ this.gutterLeft + this.gutterCenter + this.axisWidth + offsetx, ca.height - this.gutterBottom - this.axisHeight - offsety,
525
+ this.gutterLeft + this.gutterCenter + this.axisWidth + offsetx, ca.height - this.gutterBottom - offsety
526
+ );
524
527
  }
525
528
  }
526
529
 
@@ -534,15 +537,13 @@
534
537
  offsety = prop['chart.variant.threed.offsety'];
535
538
 
536
539
  // The left vertical axis
537
- pa(co, [
538
- 'b',
539
- 'm', this.gutterLeft + this.axisWidth, this.gutterTop,
540
- 'l', this.gutterLeft + this.axisWidth + offsetx, this.gutterTop - offsety,
541
- 'l', this.gutterLeft + this.axisWidth + offsetx, ca.height - this.gutterBottom - offsety,
542
- 'l',this.gutterLeft + this.axisWidth, ca.height - this.gutterBottom,
543
- 's', '#aaa',
544
- 'f','#ddd'
545
- ]);
540
+ pa2(co,
541
+ 'b m % % l % % l % % l % % s #aaa f #ddd',
542
+ this.gutterLeft + this.axisWidth, this.gutterTop,
543
+ this.gutterLeft + this.axisWidth + offsetx, this.gutterTop - offsety,
544
+ this.gutterLeft + this.axisWidth + offsetx, ca.height - this.gutterBottom - offsety,
545
+ this.gutterLeft + this.axisWidth, ca.height - this.gutterBottom
546
+ );
546
547
  }
547
548
  };
548
549
 
@@ -842,18 +843,13 @@
842
843
  co.shadowOffsetY = prop['chart.shadow.offsety'];
843
844
 
844
845
 
845
- pa(co, [
846
- 'b',
847
- 'm',coords[0] + offsetx, coords[1] - offsety,
848
- 'l',coords[0] + offsetx + coords[2], coords[1] - offsety,
849
- 'l',coords[0] + offsetx + coords[2], coords[1] - offsety + coords[3],
850
- 'l',coords[0] + offsetx,coords[1] - offsety + coords[3],
851
- 'f', 'black',
852
- 'sc', 'rgba(0,0,0,0)',
853
- 'sx', 0,
854
- 'sy', 0,
855
- 'sb', 0
856
- ]);
846
+ pa2(co,
847
+ 'b m % % l % % l % % l % % f black sc rgba(0,0,0,0) sx 0 sy 0 sb 0',
848
+ coords[0] + offsetx, coords[1] - offsety,
849
+ coords[0] + offsetx + coords[2], coords[1] - offsety,
850
+ coords[0] + offsetx + coords[2], coords[1] - offsety + coords[3],
851
+ coords[0] + offsetx,coords[1] - offsety + coords[3]
852
+ );
857
853
  }
858
854
 
859
855
 
@@ -868,23 +864,21 @@
868
864
  co.fillStyle = prop['chart.colors'][0];
869
865
  }
870
866
 
871
- pa(co, [
872
- 'b',
873
- 'm',coords[0],coords[1],
874
- 'l',coords[0] + offsetx, coords[1] - offsety,
875
- 'l',coords[0] + offsetx + coords[2], coords[1] - offsety,
876
- 'l',coords[0] + coords[2], coords[1],
877
- 'f', null
878
- ]);
879
-
880
- pa(co, [
881
- 'b',
882
- 'm',coords[0],coords[1],
883
- 'l',coords[0] + offsetx, coords[1] - offsety,
884
- 'l',coords[0] + offsetx + coords[2], coords[1] - offsety,
885
- 'l',coords[0] + coords[2], coords[1],
886
- 'f', 'rgba(255,255,255,0.4)'
887
- ]);
867
+ pa2(co,
868
+ 'b m % % l % % l % % l % % f %',
869
+ coords[0],coords[1],
870
+ coords[0] + offsetx, coords[1] - offsety,
871
+ coords[0] + offsetx + coords[2], coords[1] - offsety,
872
+ coords[0] + coords[2], coords[1]
873
+ );
874
+
875
+ pa2(co,
876
+ 'b m % % l % % l % % l % % f rgba(255,255,255,0.4)',
877
+ coords[0],coords[1],
878
+ coords[0] + offsetx, coords[1] - offsety,
879
+ coords[0] + offsetx + coords[2], coords[1] - offsety,
880
+ coords[0] + coords[2], coords[1]
881
+ );
888
882
  }
889
883
 
890
884
  this.draw3DLeftVerticalAxis();
@@ -1014,61 +1008,54 @@
1014
1008
  co.shadowOffsetX = prop['chart.shadow.offsetx'];
1015
1009
  co.shadowOffsetY = prop['chart.shadow.offsety'];
1016
1010
 
1017
- pa(co, [
1018
- 'b',
1019
- 'm',coords[0] + offsetx, coords[1] - offsety,
1020
- 'l',coords[0] + offsetx + coords[2], coords[1] - offsety,
1021
- 'l',coords[0] + offsetx + coords[2], coords[1] - offsety + coords[3],
1022
- 'l',coords[0] + offsetx,coords[1] - offsety + coords[3],
1023
- 'f', 'black',
1024
- 'sc', 'rgba(0,0,0,0)',
1025
- 'sx', 0,
1026
- 'sy', 0,
1027
- 'sb', 0
1028
- ]);
1011
+ pa2(co,
1012
+ 'b m % % l % % l % % l % % f black sc rgba(0,0,0,0) sx 0 sy 0 sb 0',
1013
+ coords[0] + offsetx, coords[1] - offsety,
1014
+ coords[0] + offsetx + coords[2], coords[1] - offsety,
1015
+ coords[0] + offsetx + coords[2], coords[1] - offsety + coords[3],
1016
+ coords[0] + offsetx,coords[1] - offsety + coords[3]
1017
+ );
1029
1018
  }
1030
1019
 
1031
1020
  // Draw the top
1032
- pa(co, [
1033
- 'b',
1034
- 'm',coords[0],coords[1],
1035
- 'l',coords[0] + offsetx, coords[1] - offsety,
1036
- 'l',coords[0] + offsetx + coords[2], coords[1] - offsety,
1037
- 'l',coords[0] + coords[2], coords[1],
1038
- 'f', color
1039
- ]);
1021
+ pa2(co,
1022
+ 'b m % % l % % l % % l % % f %',
1023
+ coords[0],coords[1],
1024
+ coords[0] + offsetx, coords[1] - offsety,
1025
+ coords[0] + offsetx + coords[2], coords[1] - offsety,
1026
+ coords[0] + coords[2], coords[1],
1027
+ color
1028
+ );
1040
1029
 
1041
1030
 
1042
1031
  // Draw the right hand side
1043
- pa(co, [
1044
- 'b',
1045
- 'm',coords[0] + coords[2],coords[1],
1046
- 'l',coords[0] + coords[2] + offsetx, coords[1] - offsety,
1047
- 'l',coords[0] + coords[2] + offsetx, coords[1] - offsety + coords[3],
1048
- 'l',coords[0] + coords[2],coords[1] + coords[3],
1049
- 'f', color
1050
- ]);
1032
+ pa2(co,
1033
+ 'b m % % l % % l % % l % % f %',
1034
+ coords[0] + coords[2],coords[1],
1035
+ coords[0] + coords[2] + offsetx, coords[1] - offsety,
1036
+ coords[0] + coords[2] + offsetx, coords[1] - offsety + coords[3],
1037
+ coords[0] + coords[2],coords[1] + coords[3],
1038
+ color
1039
+ );
1051
1040
 
1052
1041
  // Draw the LIGHTER top
1053
- pa(co, [
1054
- 'b',
1055
- 'm',coords[0],coords[1],
1056
- 'l',coords[0] + offsetx, coords[1] - offsety,
1057
- 'l',coords[0] + offsetx + coords[2], coords[1] - offsety,
1058
- 'l',coords[0] + coords[2], coords[1],
1059
- 'f', 'rgba(255,255,255,0.6)'
1060
- ]);
1042
+ pa2(co,
1043
+ 'b m % % l % % l % % l % % f rgba(255,255,255,0.6)',
1044
+ coords[0],coords[1],
1045
+ coords[0] + offsetx, coords[1] - offsety,
1046
+ coords[0] + offsetx + coords[2], coords[1] - offsety,
1047
+ coords[0] + coords[2], coords[1]
1048
+ );
1061
1049
 
1062
1050
 
1063
1051
  // Draw the DARKER right hand side
1064
- pa(co, [
1065
- 'b',
1066
- 'm',coords[0] + coords[2],coords[1],
1067
- 'l',coords[0] + coords[2] + offsetx, coords[1] - offsety,
1068
- 'l',coords[0] + coords[2] + offsetx, coords[1] - offsety + coords[3],
1069
- 'l',coords[0] + coords[2],coords[1] + coords[3],
1070
- 'f', 'rgba(0,0,0,0.3)'
1071
- ]);
1052
+ pa2(co,
1053
+ 'b m % % l % % l % % l % % f rgba(0,0,0,0.3)',
1054
+ coords[0] + coords[2],coords[1],
1055
+ coords[0] + coords[2] + offsetx, coords[1] - offsety,
1056
+ coords[0] + coords[2] + offsetx, coords[1] - offsety + coords[3],
1057
+ coords[0] + coords[2],coords[1] + coords[3]
1058
+ );
1072
1059
  }
1073
1060
 
1074
1061
 
@@ -1373,7 +1360,13 @@
1373
1360
  height = this.coords[i][3]
1374
1361
 
1375
1362
  //if (mouseX >= left && mouseX <= (left + width) && mouseY >= top && mouseY <= (top + height) ) {
1376
- pa(co, ['b','r',left,top,width,height]);
1363
+ pa2(co,
1364
+ 'b r % % % %',
1365
+ left,
1366
+ top,
1367
+ width,
1368
+ height
1369
+ );
1377
1370
 
1378
1371
  if (co.isPointInPath(mouseX, mouseY)) {
1379
1372
 
@@ -1400,8 +1393,11 @@
1400
1393
  this.highlight =
1401
1394
  this.Highlight = function (shape)
1402
1395
  {
1403
- // Add the new highlight
1404
- RG.Highlight.Rect(this, shape);
1396
+ if (typeof prop['chart.highlight.style'] === 'function') {
1397
+ (prop['chart.highlight.style'])(shape);
1398
+ } else {
1399
+ RG.Highlight.Rect(this, shape);
1400
+ }
1405
1401
  };
1406
1402
 
1407
1403
 
@@ -1506,36 +1502,23 @@
1506
1502
 
1507
1503
  // Set the top position
1508
1504
  tooltip.style.left = 0;
1509
- tooltip.style.top = canvasXY[1] + coordY - height - 7 + (adjustment || 0) + 'px';
1505
+ tooltip.style.top = window.event.pageY - height - 5 + 'px';
1510
1506
 
1511
1507
 
1512
1508
  // By default any overflow is hidden
1513
1509
  tooltip.style.overflow = '';
1514
-
1515
- // The arrow
1516
- var img = new Image();
1517
- img.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAFCAYAAACjKgd3AAAARUlEQVQYV2NkQAN79+797+RkhC4M5+/bd47B2dmZEVkBCgcmgcsgbAaA9GA1BCSBbhAuA/AagmwQPgMIGgIzCD0M0AMMAEFVIAa6UQgcAAAAAElFTkSuQmCC';
1518
- img.style.position = 'absolute';
1519
- img.id = '__rgraph_tooltip_pointer__';
1520
- img.style.top = (tooltip.offsetHeight - 2) + 'px';
1521
- tooltip.appendChild(img);
1522
-
1523
- // Reposition the tooltip if at the edges:
1524
-
1510
+
1525
1511
  // LEFT edge
1526
- if ((canvasXY[0] + coordX + (coordW / 2)- (width / 2)) < 0) {
1527
- tooltip.style.left = (canvasXY[0] + coordX - (width * 0.1)) + (coordW / 2) + 'px';
1528
- img.style.left = ((width * 0.1) - 8.5) + 'px';
1512
+ if (canvasXY[0] + mouseXY[0] - (width / 2) < 0) {
1513
+ tooltip.style.left = canvasXY[0] + mouseXY[0] - (width * 0.1) + 'px';
1529
1514
 
1530
1515
  // RIGHT edge
1531
- } else if ((canvasXY[0] + coordX + width) > doc.body.offsetWidth) {
1532
- tooltip.style.left = canvasXY[0] + coordX - (width * 0.9) + (coordW / 2) + 'px';
1533
- img.style.left = ((width * 0.9) - 8.5) + 'px';
1516
+ } else if (canvasXY[0] + mouseXY[0] + (width / 2) > doc.body.offsetWidth) {
1517
+ tooltip.style.left = canvasXY[0] + mouseXY[0] - (width * 0.9) + 'px';
1534
1518
 
1535
1519
  // Default positioning - CENTERED
1536
1520
  } else {
1537
- tooltip.style.left = (canvasXY[0] + coordX + (coordW / 2) - (width * 0.5)) + 'px';
1538
- img.style.left = ((width * 0.5) - 8.5) + 'px';
1521
+ tooltip.style.left = canvasXY[0] + mouseXY[0] - (width / 2) + 'px';
1539
1522
  }
1540
1523
  };
1541
1524
 
@@ -1698,12 +1681,12 @@
1698
1681
  // Draw vertical grid lines for the left side
1699
1682
  if (vlines) {
1700
1683
  for (var i=0; i<=numvlines; i+=1) {
1701
- pa(co, [
1702
- 'b',
1703
- 'm', this.gutterLeft + (this.axisWidth / numvlines) * i, this.gutterTop,
1704
- 'l', this.gutterLeft + (this.axisWidth / numvlines) * i, this.gutterTop + this.axisHeight,
1705
- 's', color
1706
- ]);
1684
+ pa2(co,
1685
+ 'b m % % l % % s %',
1686
+ this.gutterLeft + (this.axisWidth / numvlines) * i, this.gutterTop,
1687
+ this.gutterLeft + (this.axisWidth / numvlines) * i, this.gutterTop + this.axisHeight,
1688
+ color
1689
+ );
1707
1690
 
1708
1691
  }
1709
1692
  }
@@ -1711,12 +1694,12 @@
1711
1694
  // Draw horizontal grid lines for the left side
1712
1695
  if (hlines) {
1713
1696
  for (var i=0; i<=numhlines; i+=1) {
1714
- pa(co, [
1715
- 'b',
1716
- 'm', this.gutterLeft, this.gutterTop + (this.axisHeight / numhlines) * i,
1717
- 'l', this.gutterLeft + this.axisWidth, this.gutterTop + (this.axisHeight / numhlines) * i,
1718
- 's', color
1719
- ]);
1697
+ pa2(co,
1698
+ 'b m % % l % % s %',
1699
+ this.gutterLeft, this.gutterTop + (this.axisHeight / numhlines) * i,
1700
+ this.gutterLeft + this.axisWidth, this.gutterTop + (this.axisHeight / numhlines) * i,
1701
+ color
1702
+ );
1720
1703
  }
1721
1704
  }
1722
1705
 
@@ -1724,24 +1707,24 @@
1724
1707
  // Draw vertical grid lines for the right side
1725
1708
  if (vlines) {
1726
1709
  for (var i=0; i<=numvlines; i+=1) {
1727
- pa(co, [
1728
- 'b',
1729
- 'm', this.gutterLeft + this.gutterCenter + this.axisWidth + (this.axisWidth / numvlines) * i, this.gutterTop,
1730
- 'l', this.gutterLeft + this.gutterCenter + this.axisWidth + (this.axisWidth / numvlines) * i, this.gutterTop + this.axisHeight,
1731
- 's', color
1732
- ]);
1710
+ pa2(co,
1711
+ 'b m % % l % % s %',
1712
+ this.gutterLeft + this.gutterCenter + this.axisWidth + (this.axisWidth / numvlines) * i, this.gutterTop,
1713
+ this.gutterLeft + this.gutterCenter + this.axisWidth + (this.axisWidth / numvlines) * i, this.gutterTop + this.axisHeight,
1714
+ color
1715
+ );
1733
1716
  }
1734
1717
  }
1735
1718
 
1736
1719
  // Draw horizontal grid lines for the right side
1737
1720
  if (hlines) {
1738
1721
  for (var i=0; i<=numhlines; i+=1) {
1739
- pa(co, [
1740
- 'b',
1741
- 'm', this.gutterLeft + this.axisWidth + this.gutterCenter, this.gutterTop + (this.axisHeight / numhlines) * i,
1742
- 'l', this.gutterLeft + this.axisWidth + this.gutterCenter + this.axisWidth, this.gutterTop + (this.axisHeight / numhlines) * i,
1743
- 's', color
1744
- ]);
1722
+ pa2(co,
1723
+ 'b m % % l % % s %',
1724
+ this.gutterLeft + this.axisWidth + this.gutterCenter, this.gutterTop + (this.axisHeight / numhlines) * i,
1725
+ this.gutterLeft + this.axisWidth + this.gutterCenter + this.axisWidth, this.gutterTop + (this.axisHeight / numhlines) * i,
1726
+ color
1727
+ );
1745
1728
  }
1746
1729
  }
1747
1730