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 is just 99 (GBP) and you can |
10
+ * | the terms of the GPL. The commercial license is just 99 GBP and you can |
11
11
  * | read about it here: |
12
12
  * | http://www.rgraph.net/license |
13
13
  * o--------------------------------------------------------------------------------o
@@ -106,7 +106,7 @@
106
106
  this.properties =
107
107
  {
108
108
  'chart.size': 10,
109
- 'chart.font': 'Arial',
109
+ 'chart.font': 'Segoe UI, Arial, Verdana, sans-serif',
110
110
  'chart.bold': false,
111
111
  'chart.angle': 0,
112
112
  'chart.colors': ['black'],
@@ -133,7 +133,11 @@
133
133
  'chart.valign': 'bottom',
134
134
  'chart.link': null,
135
135
  'chart.link.target': '_self',
136
- 'chart.link.options': ''
136
+ 'chart.link.options': '',
137
+ 'chart.text.accessible': true,
138
+ 'chart.text.accessible.overflow': 'visible',
139
+ 'chart.text.accessible.pointerevents': false,
140
+ 'chart.clearto': 'rgba(0,0,0,0)'
137
141
  }
138
142
 
139
143
  /**
@@ -170,7 +174,6 @@
170
174
  ca = this.canvas,
171
175
  co = ca.getContext('2d'),
172
176
  prop = this.properties,
173
- pa = RG.Path,
174
177
  pa2 = RG.path2,
175
178
  win = window,
176
179
  doc = document,
@@ -224,10 +227,9 @@
224
227
 
225
228
 
226
229
  // Convert uppercase letters to dot+lower case letter
227
- name = name.replace(/([A-Z])/g, function (str)
228
- {
229
- return '.' + String(RegExp.$1).toLowerCase();
230
- });
230
+ while(name.match(/([A-Z])/)) {
231
+ name = name.replace(/([A-Z])/, '.' + RegExp.$1.toLowerCase());
232
+ }
231
233
 
232
234
 
233
235
 
@@ -324,35 +326,36 @@
324
326
 
325
327
  // ------------- DRAW TEXT HERE -------------
326
328
  co.fillStyle = prop['chart.colors'][0];
327
-
328
- var ret = RG.Text2(this, {'font': prop['chart.font'],
329
- 'size': prop['chart.size'],
330
- 'x': this.x,
331
- 'y': this.y,
332
- 'text': this.text,
333
- 'bold': prop['chart.bold'],
334
- 'angle': prop['chart.angle'],
335
- 'bounding': prop['chart.bounding'],
336
- 'bounding.fill': prop['chart.bounding.fill'],
337
- 'bounding.stroke': prop['chart.bounding.stroke'],
338
- 'bounding.shadow': prop['chart.bounding.shadow'],
339
- 'bounding.shadow.color': prop['chart.bounding.shadow.color'],
340
- 'bounding.shadow.blur': prop['chart.bounding.shadow.blur'],
341
- 'bounding.shadow.offsetx': prop['chart.bounding.shadow.offsetx'],
342
- 'bounding.shadow.offsety': prop['chart.bounding.shadow.offsety'],
343
- 'marker': prop['chart.marker'],
344
- 'halign': prop['chart.halign'],
345
- 'valign': prop['chart.valign']
346
- });
329
+
330
+ var ret = RG.text2(this, {
331
+ font: prop['chart.font'],
332
+ size: prop['chart.size'],
333
+ x: this.x,
334
+ y: this.y,
335
+ text: this.text,
336
+ bold: prop['chart.bold'],
337
+ angle: prop['chart.angle'],
338
+ bounding: prop['chart.bounding'],
339
+ 'bounding.fill': prop['chart.bounding.fill'],
340
+ 'bounding.stroke': prop['chart.bounding.stroke'],
341
+ 'bounding.shadow': prop['chart.bounding.shadow'],
342
+ 'bounding.shadow.color': prop['chart.bounding.shadow.color'],
343
+ 'bounding.shadow.blur': prop['chart.bounding.shadow.blur'],
344
+ 'bounding.shadow.offsetx': prop['chart.bounding.shadow.offsetx'],
345
+ 'bounding.shadow.offsety': prop['chart.bounding.shadow.offsety'],
346
+ marker: prop['chart.marker'],
347
+ halign: prop['chart.halign'],
348
+ valign: prop['chart.valign']
349
+ });
347
350
 
348
351
 
349
352
  // store the dimensions
350
353
  this.coords.push({
351
- 0: ret.x, 'x': ret.x,
352
- 1: ret.y, 'y': ret.y,
353
- 2: ret.width, 'width': ret.width,
354
- 3: ret.height, 'height': ret.height
355
- });
354
+ 0: ret.x, 'x': ret.x,
355
+ 1: ret.y, 'y': ret.y,
356
+ 2: ret.width, 'width': ret.width,
357
+ 3: ret.height, 'height': ret.height
358
+ });
356
359
 
357
360
 
358
361
 
@@ -460,46 +463,35 @@
460
463
  this.positionTooltip = function (obj, x, y, tooltip, idx)
461
464
  {
462
465
  var coords = obj.coords[0];
463
- var coordX = coords.x;
464
- var coordY = coords.y;
466
+ var coordX = parseFloat(coords.x);
467
+ var coordY = parseFloat(coords.y);
465
468
  var coordW = coords.width;
466
469
  var coordH = coords.height;
467
- var canvasXY = RGraph.getCanvasXY(obj.canvas);
470
+ var canvasXY = RG.getCanvasXY(obj.canvas);
471
+ var mouseXY = RG.getMouseXY(window.event);
468
472
  var width = tooltip.offsetWidth;
469
473
  var height = tooltip.offsetHeight;
470
474
 
471
475
  // Set the top position
472
476
  tooltip.style.left = 0;
473
-
474
- tooltip.style.top = canvasXY[1] + coordY + (coordH / 2) - height + 'px';
475
-
477
+ tooltip.style.top = window.event.pageY - height - 5 + 'px';
478
+
476
479
  // By default any overflow is hidden
477
480
  tooltip.style.overflow = '';
478
-
479
- // The arrow
480
- var img = new Image();
481
- img.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAFCAYAAACjKgd3AAAARUlEQVQYV2NkQAN79+797+RkhC4M5+/bd47B2dmZEVkBCgcmgcsgbAaA9GA1BCSBbhAuA/AagmwQPgMIGgIzCD0M0AMMAEFVIAa6UQgcAAAAAElFTkSuQmCC';
482
- img.style.position = 'absolute';
483
- img.id = '__rgraph_tooltip_pointer__';
484
- img.style.top = (tooltip.offsetHeight - 2) + 'px';
485
- tooltip.appendChild(img);
486
481
 
487
482
  // Reposition the tooltip if at the edges:
488
483
 
489
484
  // LEFT edge
490
- if ((canvasXY[0] + coordX + (coordW / 2) - (width / 2)) < 10) {
491
- tooltip.style.left = (canvasXY[0] + coordX - (width * 0.1)) + (coordW / 2) + 'px';
492
- img.style.left = ((width * 0.1) - 8.5) + 'px';
485
+ if (canvasXY[0] + mouseXY[0] - (width / 2) < 0) {
486
+ tooltip.style.left = canvasXY[0] + mouseXY[0] - (width * 0.1) + 'px';
493
487
 
494
488
  // RIGHT edge
495
- } else if ((canvasXY[0] + coordX + (coordW / 2) + (width / 2)) > (doc.body.offsetWidth - 10)) {
496
- tooltip.style.left = canvasXY[0] + coordX - (width * 0.9) + (coordW / 2) + 'px';
497
- img.style.left = ((width * 0.9) - 8.5) + 'px';
489
+ } else if (canvasXY[0] + mouseXY[0] + (width / 2) > doc.body.offsetWidth) {
490
+ tooltip.style.left = canvasXY[0] + mouseXY[0] - (width * 0.9) + 'px';
498
491
 
499
492
  // Default positioning - CENTERED
500
493
  } else {
501
- tooltip.style.left = (canvasXY[0] + coordX + (coordW / 2) - (width * 0.5)) + 'px';
502
- img.style.left = ((width * 0.5) - 8.5) + 'px';
494
+ tooltip.style.left = canvasXY[0] + mouseXY[0] - (width / 2) + 'px';
503
495
  }
504
496
  };
505
497
 
@@ -514,8 +506,11 @@
514
506
  this.highlight =
515
507
  this.Highlight = function (shape)
516
508
  {
517
- // Add the new highlight
518
- RG.Highlight.Rect(this, shape);
509
+ if (typeof prop['chart.highlight.style'] === 'function') {
510
+ (prop['chart.highlight.style'])(shape);
511
+ } else {
512
+ RG.Highlight.Rect(this, shape);
513
+ }
519
514
  };
520
515
 
521
516
 
@@ -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 is just 99 (GBP) and you can |
10
+ * | the terms of the GPL. The commercial license is just 99 GBP and you can |
11
11
  * | read about it here: |
12
12
  * | http://www.rgraph.net/license |
13
13
  * o--------------------------------------------------------------------------------o
@@ -101,8 +101,11 @@
101
101
  'chart.colors': ['black'],
102
102
  'chart.title.color': null, // Defaults to same as chart.colors
103
103
  'chart.text.color': null, // Defaults to same as chart.colors
104
- 'chart.text.font': 'Arial',
104
+ 'chart.text.font': 'Segoe UI, Arial, Verdana, sans-serif',
105
105
  'chart.text.size': 12,
106
+ 'chart.text.accessible': true,
107
+ 'chart.text.accessible.overflow':'visible',
108
+ 'chart.text.accessible.pointerevents': false,
106
109
  'chart.align': 'bottom',
107
110
  'chart.numlabels': 5,
108
111
  'chart.scale.visible': true,
@@ -130,7 +133,8 @@
130
133
  'chart.events.click': null,
131
134
  'chart.events.mousemove': null,
132
135
  'chart.xaxispos': 'bottom',
133
- 'chart.yaxispos': 'left'
136
+ 'chart.yaxispos': 'left',
137
+ 'chart.clearto': 'rgba(0,0,0,0)'
134
138
  }
135
139
 
136
140
  /**
@@ -165,7 +169,6 @@
165
169
  ca = this.canvas,
166
170
  co = ca.getContext('2d'),
167
171
  prop = this.properties,
168
- pa = RG.Path,
169
172
  pa2 = RG.path2,
170
173
  win = window,
171
174
  doc = document,
@@ -216,10 +219,9 @@
216
219
 
217
220
 
218
221
  // Convert uppercase letters to dot+lower case letter
219
- name = name.replace(/([A-Z])/g, function (str)
220
- {
221
- return '.' + String(RegExp.$1).toLowerCase();
222
- });
222
+ while(name.match(/([A-Z])/)) {
223
+ name = name.replace(/([A-Z])/, '.' + RegExp.$1.toLowerCase());
224
+ }
223
225
 
224
226
  /**
225
227
  * Make the tickmarks align if labels are specified
@@ -422,40 +424,31 @@
422
424
  var coordW = ca.width - obj.gutterLeft - obj.gutterRight;
423
425
  var coordH = prop['chart.text.size'] * 1.5;
424
426
  var canvasXY = RG.getCanvasXY(ca);
427
+ var mouseXY = RG.getMouseXY(window.event);
425
428
  var width = tooltip.offsetWidth;
426
429
  var height = tooltip.offsetHeight;
430
+
427
431
 
428
432
  // Set the top position
429
433
  tooltip.style.left = 0;
430
- tooltip.style.top = canvasXY[1] + this.y - height - 5 + (prop['chart.align'] == 'top' ? ((prop['chart.text.size'] * 1.5) / 2) * -1 : ((prop['chart.text.size'] * 1.5) / 2)) + 'px';
434
+ tooltip.style.top = window.event.pageY - height - 5 + 'px';
431
435
 
432
436
  // By default any overflow is hidden
433
437
  tooltip.style.overflow = '';
434
-
435
- // The arrow
436
- var img = new Image();
437
- img.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAFCAYAAACjKgd3AAAARUlEQVQYV2NkQAN79+797+RkhC4M5+/bd47B2dmZEVkBCgcmgcsgbAaA9GA1BCSBbhAuA/AagmwQPgMIGgIzCD0M0AMMAEFVIAa6UQgcAAAAAElFTkSuQmCC';
438
- img.style.position = 'absolute';
439
- img.id = '__rgraph_tooltip_pointer__';
440
- img.style.top = (tooltip.offsetHeight - 2) + 'px';
441
- tooltip.appendChild(img);
442
438
 
443
439
  // Reposition the tooltip if at the edges:
444
-
440
+
445
441
  // LEFT edge
446
- if ((canvasXY[0] + coordX + (coordW / 2) - (width / 2)) < 10) {
447
- tooltip.style.left = (canvasXY[0] + coordX - (width * 0.1)) + (coordW / 2) + 'px';
448
- img.style.left = ((width * 0.1) - 8.5) + 'px';
442
+ if (canvasXY[0] + mouseXY[0] - (width / 2) < 0) {
443
+ tooltip.style.left = canvasXY[0] + mouseXY[0] - (width * 0.1) + 'px';
449
444
 
450
445
  // RIGHT edge
451
- } else if ((canvasXY[0] + coordX + (coordW / 2) + (width / 2)) > (doc.body.offsetWidth - 10) ) {
452
- tooltip.style.left = canvasXY[0] + coordX - (width * 0.9) + (coordW / 2) + 'px';
453
- img.style.left = ((width * 0.9) - 8.5) + 'px';
446
+ } else if (canvasXY[0] + mouseXY[0] + (width / 2) > doc.body.offsetWidth) {
447
+ tooltip.style.left = canvasXY[0] + mouseXY[0] - (width * 0.9) + 'px';
454
448
 
455
449
  // Default positioning - CENTERED
456
450
  } else {
457
- tooltip.style.left = (canvasXY[0] + coordX + (coordW / 2) - (width * 0.5)) + 'px';
458
- img.style.left = ((width * 0.5) - 8.5) + 'px';
451
+ tooltip.style.left = canvasXY[0] + mouseXY[0] - (width / 2) + 'px';
459
452
  }
460
453
  };
461
454
 
@@ -470,7 +463,9 @@
470
463
  this.highlight =
471
464
  this.Highlight = function (shape)
472
465
  {
473
- // When showing tooltips, this method can be used to highlight the X axis
466
+ if (typeof prop['chart.highlight.style'] === 'function') {
467
+ (prop['chart.highlight.style'])(shape);
468
+ }
474
469
  };
475
470
 
476
471
 
@@ -608,7 +603,7 @@
608
603
  /**
609
604
  * Draw the main horizontal line
610
605
  */
611
- pa(co, ['b','m',x, Math.round(y),'l',x + width, Math.round(y),'s',co.strokeStyle]);
606
+ pa2(co, ['b','m',x, Math.round(y),'l',x + width, Math.round(y),'s',co.strokeStyle]);
612
607
 
613
608
  /**
614
609
  * Draw the axis tickmarks
@@ -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 is just 99 (GBP) and you can |
10
+ * | the terms of the GPL. The commercial license is just 99 GBP and you can |
11
11
  * | read about it here: |
12
12
  * | http://www.rgraph.net/license |
13
13
  * o--------------------------------------------------------------------------------o
@@ -99,12 +99,15 @@
99
99
  'chart.colors': ['black'],
100
100
  'chart.title': '',
101
101
  'chart.title.color': null,
102
- 'chart.text.color': null,
103
102
  'chart.numticks': 5,
104
103
  'chart.numlabels': 5,
105
104
  'chart.labels.specific': null,
106
- 'chart.text.font': 'Arial',
105
+ 'chart.text.font': 'Segoe UI, Arial, Verdana, sans-serif',
107
106
  'chart.text.size': 12,
107
+ 'chart.text.color': null,
108
+ 'chart.text.accessible': true,
109
+ 'chart.text.accessible.overflow':'visible',
110
+ 'chart.text.accessible.pointerevents': false,
108
111
  'chart.align': 'left',
109
112
  'hart.scale.formatter': null,
110
113
  'chart.scale.point': '.',
@@ -126,7 +129,8 @@
126
129
  'chart.tooltips.event': 'onclick',
127
130
  'chart.xaxispos': 'bottom',
128
131
  'chart.events.click': null,
129
- 'chart.events.mousemove': null
132
+ 'chart.events.mousemove': null,
133
+ 'chart.clearto': 'rgba(0,0,0,0)'
130
134
  }
131
135
 
132
136
 
@@ -163,7 +167,6 @@
163
167
  ca = this.canvas,
164
168
  co = ca.getContext('2d'),
165
169
  prop = this.properties,
166
- pa = RG.Path,
167
170
  pa2 = RG.path2,
168
171
  win = window,
169
172
  doc = document,
@@ -220,10 +223,9 @@
220
223
 
221
224
 
222
225
  // Convert uppercase letters to dot+lower case letter
223
- name = name.replace(/([A-Z])/g, function (str)
224
- {
225
- return '.' + String(RegExp.$1).toLowerCase();
226
- });
226
+ while(name.match(/([A-Z])/)) {
227
+ name = name.replace(/([A-Z])/, '.' + RegExp.$1.toLowerCase());
228
+ }
227
229
 
228
230
 
229
231
 
@@ -421,44 +423,31 @@
421
423
  var coordY = obj.gutterTop;
422
424
  var coordH = ca.height - obj.gutterTop - obj.gutterBottom;
423
425
  var canvasXY = RG.getCanvasXY(ca);
426
+ var mouseXY = RG.getMouseXY(window.event);
424
427
 
425
428
  var width = tooltip.offsetWidth;
426
429
  var height = tooltip.offsetHeight;
427
430
 
428
431
  // Set the top position
429
432
  tooltip.style.left = 0;
430
- tooltip.style.top = canvasXY[1] + ((ca.height - this.gutterTop - this.gutterBottom) / 2) + 'px';
433
+ tooltip.style.top = window.event.pageY - height - 5 + 'px';
431
434
 
432
435
  // By default any overflow is hidden
433
436
  tooltip.style.overflow = '';
434
-
435
- // The arrow
436
- var img = new Image();
437
- img.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAFCAYAAACjKgd3AAAARUlEQVQYV2NkQAN79+797+RkhC4M5+/bd47B2dmZEVkBCgcmgcsgbAaA9GA1BCSBbhAuA/AagmwQPgMIGgIzCD0M0AMMAEFVIAa6UQgcAAAAAElFTkSuQmCC';
438
- img.style.position = 'absolute';
439
- img.id = '__rgraph_tooltip_pointer__';
440
- img.style.top = (tooltip.offsetHeight - 2) + 'px';
441
- tooltip.appendChild(img);
442
437
 
443
438
  // Reposition the tooltip if at the edges:
444
439
 
445
440
  // LEFT edge
446
- if ((canvasXY[0] + coordX + (coordW / 2) - (width / 2)) < 10) {
447
- tooltip.style.left = prop['chart.align'] == 'right' ? canvasXY[0] + obj.x - (width * 0.1) + (coordW / 2) + 'px'
448
- : (canvasXY[0] + coordX - (width * 0.1)) + (coordW / 2) + 'px';
449
- img.style.left = (width * 0.1) - 8.5 + 'px';
441
+ if (canvasXY[0] + mouseXY[0] - (width / 2) < 0) {
442
+ tooltip.style.left = canvasXY[0] + mouseXY[0] - (width * 0.1) + 'px';
450
443
 
451
444
  // RIGHT edge
452
- } else if ((canvasXY[0] + coordX + (width / 2)) > document.body.offsetWidth) {
453
- tooltip.style.left = prop['chart.align'] == 'right' ? canvasXY[0] + obj.x - (width * 0.9) + (coordW / 2) + 'px'
454
- : canvasXY[0] + coordX - (width * 0.9) + (coordW / 2) + 'px';
455
- img.style.left = ((width * 0.9) - 8.5) + 'px';
445
+ } else if (canvasXY[0] + mouseXY[0] + (width / 2) > doc.body.offsetWidth) {
446
+ tooltip.style.left = canvasXY[0] + mouseXY[0] - (width * 0.9) + 'px';
456
447
 
457
448
  // Default positioning - CENTERED
458
449
  } else {
459
- tooltip.style.left = prop['chart.align'] == 'right' ? canvasXY[0] + obj.x - (width / 2) + (coordW / 2) + 'px'
460
- : canvasXY[0] + obj.x - (width / 2) - (coordW / 2) + 'px';
461
- img.style.left = ((width * 0.5) - 8.5) + 'px';
450
+ tooltip.style.left = canvasXY[0] + mouseXY[0] - (width / 2) + 'px';
462
451
  }
463
452
  };
464
453
 
@@ -473,7 +462,9 @@
473
462
  this.highlight =
474
463
  this.Highlight = function (shape)
475
464
  {
476
- // When showing tooltips, this method can be used to highlight the X axis
465
+ if (typeof prop['chart.highlight.style'] === 'function') {
466
+ (prop['chart.highlight.style'])(shape);
467
+ }
477
468
  };
478
469
 
479
470
 
@@ -554,7 +545,7 @@
554
545
  {
555
546
  // Allow both axis.xxx and chart.xxx to prevent any confusion that may arise
556
547
  for (i in prop) {
557
- if (typeof(i) == 'string') {
548
+ if (typeof i == 'string') {
558
549
  var key = i.replace(/^chart\./, 'axis.');
559
550
 
560
551
  prop[key] = prop[i];
@@ -602,7 +593,7 @@
602
593
  /**
603
594
  * Draw the main vertical line
604
595
  */
605
- pa(co,['b','m',Math.round(x), y,'l',Math.round(x), y + height,'s',color]);
596
+ pa2(co,['b','m',Math.round(x), y,'l',Math.round(x), y + height,'s',color]);
606
597
 
607
598
  /**
608
599
  * Draw the axes tickmarks
@@ -614,13 +605,13 @@
614
605
 
615
606
  co.beginPath();
616
607
  for (var i=(notopendtick ? 1 : 0); i<=(numticks - (nobottomendtick || xaxispos == 'center'? 1 : 0)); ++i) {
617
- pa(co, ['m',align == 'right' ? x + 3 : x - 3, Math.round(y + (gap *i)),'l',x, Math.round(y + (gap *i))]);
608
+ pa2(co, ['m',align == 'right' ? x + 3 : x - 3, Math.round(y + (gap *i)),'l',x, Math.round(y + (gap *i))]);
618
609
  }
619
610
 
620
611
  // Draw the bottom halves ticks if the X axis is in the center
621
612
  if (xaxispos == 'center') {
622
613
  for (var i=1; i<=numticks; ++i) {
623
- pa(co, ['m',align == 'right' ? x + 3 : x - 3, Math.round(y + halfheight + (gap *i)),'l',x, Math.round(y + halfheight + (gap *i))]);
614
+ pa2(co, ['m',align == 'right' ? x + 3 : x - 3, Math.round(y + halfheight + (gap *i)),'l',x, Math.round(y + halfheight + (gap *i))]);
624
615
  }
625
616
  }
626
617
  co.stroke();
@@ -653,14 +644,14 @@
653
644
  }
654
645
 
655
646
  RG.text2(this, {
656
- 'font':font,
657
- 'size':size,
658
- 'x':x - (align == 'right' ? -5 : 5),
659
- 'y':(i * gap) + this.gutterTop,
660
- 'text':labels_specific[i],
661
- 'valign':'center',
662
- 'halign':align == 'right' ? 'left' : 'right',
663
- 'tag': 'scale'
647
+ 'font': font,
648
+ 'size': size,
649
+ 'x': x - (align == 'right' ? -5 : 5),
650
+ 'y': (i * gap) + this.gutterTop,
651
+ 'text': labels_specific[i],
652
+ 'valign': 'center',
653
+ 'halign': align == 'right' ? 'left' : 'right',
654
+ 'tag': 'scale'
664
655
  });
665
656
 
666
657
  /**
@@ -773,14 +764,17 @@
773
764
  }
774
765
 
775
766
 
776
- RG.Text2(this, {'font':font,
777
- 'size':size + 2,
778
- 'x':align == 'right' ? x + width + 8 : x - width - 8,
779
- 'y':height / 2 + this.gutterTop,
780
- 'text':title,
781
- 'valign':'bottom',
782
- 'halign':'center',
783
- 'angle':align == 'right' ? 90 : -90});
767
+ RG.text2(this, {
768
+ font:font,
769
+ size:size + 2,
770
+ x:align == 'right' ? x + width + 8 : x - width - 8,
771
+ y:height / 2 + this.gutterTop,
772
+ text:title,
773
+ valign:'bottom',
774
+ halign:'center',
775
+ angle:align == 'right' ? 90 : -90,
776
+ accessible: false
777
+ });
784
778
  co.stroke();
785
779
  }
786
780
  };