rgraph-rails 1.0.8 → 4.62

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 +4 -4
  2. data/README.md +3 -3
  3. data/lib/rgraph-rails/version.rb +1 -1
  4. data/vendor/assets/javascripts/RGraph.bar.js +16 -8
  5. data/vendor/assets/javascripts/RGraph.bipolar.js +1 -1
  6. data/vendor/assets/javascripts/RGraph.common.annotate.js +1 -1
  7. data/vendor/assets/javascripts/RGraph.common.context.js +1 -1
  8. data/vendor/assets/javascripts/RGraph.common.core.js +84 -7
  9. data/vendor/assets/javascripts/RGraph.common.csv.js +1 -1
  10. data/vendor/assets/javascripts/RGraph.common.deprecated.js +1 -1
  11. data/vendor/assets/javascripts/RGraph.common.dynamic.js +1 -1
  12. data/vendor/assets/javascripts/RGraph.common.effects.js +1 -1
  13. data/vendor/assets/javascripts/RGraph.common.key.js +3 -3
  14. data/vendor/assets/javascripts/RGraph.common.resizing.js +1 -1
  15. data/vendor/assets/javascripts/RGraph.common.sheets.js +1 -1
  16. data/vendor/assets/javascripts/RGraph.common.tooltips.js +1 -1
  17. data/vendor/assets/javascripts/RGraph.common.zoom.js +1 -1
  18. data/vendor/assets/javascripts/RGraph.drawing.background.js +1 -1
  19. data/vendor/assets/javascripts/RGraph.drawing.circle.js +1 -1
  20. data/vendor/assets/javascripts/RGraph.drawing.image.js +1 -1
  21. data/vendor/assets/javascripts/RGraph.drawing.marker1.js +1 -1
  22. data/vendor/assets/javascripts/RGraph.drawing.marker2.js +1 -1
  23. data/vendor/assets/javascripts/RGraph.drawing.marker3.js +1 -1
  24. data/vendor/assets/javascripts/RGraph.drawing.poly.js +1 -1
  25. data/vendor/assets/javascripts/RGraph.drawing.rect.js +1 -1
  26. data/vendor/assets/javascripts/RGraph.drawing.text.js +1 -1
  27. data/vendor/assets/javascripts/RGraph.drawing.xaxis.js +1 -1
  28. data/vendor/assets/javascripts/RGraph.drawing.yaxis.js +1 -1
  29. data/vendor/assets/javascripts/RGraph.fuel.js +1 -1
  30. data/vendor/assets/javascripts/RGraph.funnel.js +1 -1
  31. data/vendor/assets/javascripts/RGraph.gantt.js +1 -1
  32. data/vendor/assets/javascripts/RGraph.gauge.js +1 -1
  33. data/vendor/assets/javascripts/RGraph.hbar.js +228 -2
  34. data/vendor/assets/javascripts/RGraph.hprogress.js +1 -1
  35. data/vendor/assets/javascripts/RGraph.line.js +27 -5
  36. data/vendor/assets/javascripts/RGraph.meter.js +1 -1
  37. data/vendor/assets/javascripts/RGraph.modaldialog.js +1 -1
  38. data/vendor/assets/javascripts/RGraph.odo.js +1 -1
  39. data/vendor/assets/javascripts/RGraph.pie.js +1 -1
  40. data/vendor/assets/javascripts/RGraph.radar.js +1 -1
  41. data/vendor/assets/javascripts/RGraph.rose.js +1 -1
  42. data/vendor/assets/javascripts/RGraph.rscatter.js +1 -1
  43. data/vendor/assets/javascripts/RGraph.scatter.js +161 -34
  44. data/vendor/assets/javascripts/RGraph.semicircularprogress.js +1 -1
  45. data/vendor/assets/javascripts/RGraph.svg.bar.js +772 -103
  46. data/vendor/assets/javascripts/RGraph.svg.common.ajax.js +1 -1
  47. data/vendor/assets/javascripts/RGraph.svg.common.core.js +806 -231
  48. data/vendor/assets/javascripts/RGraph.svg.common.csv.js +1 -1
  49. data/vendor/assets/javascripts/RGraph.svg.common.fx.js +24 -24
  50. data/vendor/assets/javascripts/RGraph.svg.common.key.js +206 -0
  51. data/vendor/assets/javascripts/RGraph.svg.common.sheets.js +1 -1
  52. data/vendor/assets/javascripts/RGraph.svg.common.tooltips.js +63 -22
  53. data/vendor/assets/javascripts/RGraph.svg.hbar.js +351 -91
  54. data/vendor/assets/javascripts/RGraph.svg.line.js +159 -64
  55. data/vendor/assets/javascripts/RGraph.svg.pie.js +402 -51
  56. data/vendor/assets/javascripts/RGraph.svg.radar.js +320 -143
  57. data/vendor/assets/javascripts/RGraph.svg.rose.js +1818 -0
  58. data/vendor/assets/javascripts/RGraph.svg.scatter.js +1262 -0
  59. data/vendor/assets/javascripts/RGraph.svg.semicircularprogress.js +106 -57
  60. data/vendor/assets/javascripts/RGraph.svg.waterfall.js +1253 -0
  61. data/vendor/assets/javascripts/RGraph.thermometer.js +7 -6
  62. data/vendor/assets/javascripts/RGraph.vprogress.js +1 -1
  63. data/vendor/assets/javascripts/RGraph.waterfall.js +1 -1
  64. data/vendor/assets/javascripts/financial-data.js +1067 -0
  65. metadata +8 -5
  66. data/vendor/assets/javascripts/RGraph.cornergauge.js +0 -71
  67. data/vendor/assets/javascripts/RGraph.thermometer.old.js +0 -68
@@ -1,4 +1,4 @@
1
- // version: 2017-01-02
1
+ // version: 2017-05-08
2
2
  /**
3
3
  * o--------------------------------------------------------------------------------o
4
4
  * | This file is part of the RGraph package - you can learn more at: |
@@ -1,4 +1,4 @@
1
- // version: 2017-01-02
1
+ // version: 2017-05-08
2
2
  /**
3
3
  * o--------------------------------------------------------------------------------o
4
4
  * | This file is part of the RGraph package - you can learn more at: |
@@ -736,11 +736,11 @@
736
736
  jQuery('#rgraph_hblinds_' + i + '_' + obj.id).animate({height: 0}, duration);
737
737
  }
738
738
 
739
- setTimeout(function () {this.container.removeChild(doc.getElementById('rgraph_hblinds_0_' + obj.id));}, duration);
740
- setTimeout(function () {this.container.removeChild(doc.getElementById('rgraph_hblinds_1_' + obj.id));}, duration);
741
- setTimeout(function () {this.container.removeChild(doc.getElementById('rgraph_hblinds_2_' + obj.id));}, duration);
742
- setTimeout(function () {this.container.removeChild(doc.getElementById('rgraph_hblinds_3_' + obj.id));}, duration);
743
- setTimeout(function () {this.container.removeChild(doc.getElementById('rgraph_hblinds_4_' + obj.id));}, duration);
739
+ setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_hblinds_0_' + obj.id));}, duration);
740
+ setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_hblinds_1_' + obj.id));}, duration);
741
+ setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_hblinds_2_' + obj.id));}, duration);
742
+ setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_hblinds_3_' + obj.id));}, duration);
743
+ setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_hblinds_4_' + obj.id));}, duration);
744
744
  setTimeout(function () {callback(obj);}, duration);
745
745
 
746
746
  return this;
@@ -841,21 +841,21 @@
841
841
  div.style.top = 0;
842
842
  div.style.position = 'absolute';
843
843
  div.style.backgroundColor = color;
844
- this.container.appendChild(div);
844
+ obj.container.appendChild(div);
845
845
 
846
846
  jQuery('#rgraph_vblinds_' + i + '_' + obj.id).animate({width: 0}, duration);
847
847
  }
848
848
 
849
- setTimeout(function () {doc.body.removeChild(doc.getElementById('rgraph_vblinds_0_' + obj.id));}, duration + 100);
850
- setTimeout(function () {doc.body.removeChild(doc.getElementById('rgraph_vblinds_1_' + obj.id));}, duration + 100);
851
- setTimeout(function () {doc.body.removeChild(doc.getElementById('rgraph_vblinds_2_' + obj.id));}, duration + 100);
852
- setTimeout(function () {doc.body.removeChild(doc.getElementById('rgraph_vblinds_3_' + obj.id));}, duration + 100);
853
- setTimeout(function () {doc.body.removeChild(doc.getElementById('rgraph_vblinds_4_' + obj.id));}, duration + 100);
854
- setTimeout(function () {doc.body.removeChild(doc.getElementById('rgraph_vblinds_5_' + obj.id));}, duration + 100);
855
- setTimeout(function () {doc.body.removeChild(doc.getElementById('rgraph_vblinds_6_' + obj.id));}, duration + 100);
856
- setTimeout(function () {doc.body.removeChild(doc.getElementById('rgraph_vblinds_7_' + obj.id));}, duration + 100);
857
- setTimeout(function () {doc.body.removeChild(doc.getElementById('rgraph_vblinds_8_' + obj.id));}, duration + 100);
858
- setTimeout(function () {doc.body.removeChild(doc.getElementById('rgraph_vblinds_9_' + obj.id));}, duration + 100);
849
+ setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_vblinds_0_' + obj.id));}, duration + 100);
850
+ setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_vblinds_1_' + obj.id));}, duration + 100);
851
+ setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_vblinds_2_' + obj.id));}, duration + 100);
852
+ setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_vblinds_3_' + obj.id));}, duration + 100);
853
+ setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_vblinds_4_' + obj.id));}, duration + 100);
854
+ setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_vblinds_5_' + obj.id));}, duration + 100);
855
+ setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_vblinds_6_' + obj.id));}, duration + 100);
856
+ setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_vblinds_7_' + obj.id));}, duration + 100);
857
+ setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_vblinds_8_' + obj.id));}, duration + 100);
858
+ setTimeout(function () {obj.container.removeChild(doc.getElementById('rgraph_vblinds_9_' + obj.id));}, duration + 100);
859
859
 
860
860
  setTimeout(function () {callback(obj);}, duration + 100);
861
861
 
@@ -973,7 +973,7 @@
973
973
 
974
974
  jQuery(this.svg).animate({left:0,top:0}, duration, function ()
975
975
  {
976
- callback(this);
976
+ callback(obj);
977
977
  });
978
978
 
979
979
  return this;
@@ -1223,13 +1223,13 @@
1223
1223
 
1224
1224
  setTimeout(function ()
1225
1225
  {
1226
- this.container.removeChild(doc.getElementById('rgraph_vscissors_0' + '_' + this.id));
1227
- this.container.removeChild(doc.getElementById('rgraph_vscissors_1' + '_' + this.id));
1228
- this.container.removeChild(doc.getElementById('rgraph_vscissors_2' + '_' + this.id));
1229
- this.container.removeChild(doc.getElementById('rgraph_vscissors_3' + '_' + this.id));
1230
- this.container.removeChild(doc.getElementById('rgraph_vscissors_4' + '_' + this.id));
1226
+ obj.container.removeChild(doc.getElementById('rgraph_vscissors_0' + '_' + obj.id));
1227
+ obj.container.removeChild(doc.getElementById('rgraph_vscissors_1' + '_' + obj.id));
1228
+ obj.container.removeChild(doc.getElementById('rgraph_vscissors_2' + '_' + obj.id));
1229
+ obj.container.removeChild(doc.getElementById('rgraph_vscissors_3' + '_' + obj.id));
1230
+ obj.container.removeChild(doc.getElementById('rgraph_vscissors_4' + '_' + obj.id));
1231
1231
 
1232
- callback(this);
1232
+ callback(obj);
1233
1233
 
1234
1234
  }, duration);
1235
1235
 
@@ -0,0 +1,206 @@
1
+ // version: 2017-05-08
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 licensed under the Open Source MIT license. That means that it's |
9
+ * | totally free to use! |
10
+ * o--------------------------------------------------------------------------------o
11
+ */
12
+
13
+ RGraph = window.RGraph || {isRGraph: true};
14
+ RGraph.SVG = RGraph.SVG || {};
15
+ RGraph.SVG.HTML = RGraph.SVG.HTML || {};
16
+
17
+ // Module pattern
18
+ (function (win, doc, undefined)
19
+ {
20
+ var RG = RGraph,
21
+ ua = navigator.userAgent,
22
+ ma = Math;
23
+
24
+
25
+
26
+
27
+ /**
28
+ * Draws the graph key (used by various graphs)
29
+ *
30
+ * @param object obj The graph object
31
+ * @param array key An array of the texts to be listed in the key
32
+ * @param colors An array of the colors to be used
33
+ */
34
+ RG.SVG.drawKey = function (obj)
35
+ {
36
+ var prop = obj.properties,
37
+ key = prop.key,
38
+ colors = prop.keyColors || prop.colors,
39
+ defaultFont = 'Arial',
40
+ blobSize = 0,
41
+ width = 0;
42
+
43
+ // Work out the center point of the SVG tag
44
+ var centerx = obj.svg.getAttribute('width') / 2;
45
+
46
+
47
+
48
+
49
+ // First measure the length so that the key can be centered
50
+ for (var i=0,length = 0; i<key.length; i++) {
51
+
52
+ // First measure the text
53
+ var textDimensions = RG.SVG.measureText({
54
+ text: key[i],
55
+ bold: prop.keyTextBold || false,
56
+ font: prop.keyTextFont || prop.textFont || defaultFont,
57
+ size: prop.keyTextSize || prop.textSize
58
+ });
59
+
60
+ blobSize = ma.max(blobSize, textDimensions[1]);
61
+
62
+ width = width + 10 + blobSize + 5 + textDimensions[0];
63
+ }
64
+
65
+ // Center the key
66
+ x = centerx - width / 2;
67
+
68
+
69
+
70
+
71
+
72
+
73
+
74
+ // Loop thru the key and draw them
75
+ for (var i=0,y=prop.gutterTop - 5; i<key.length; ++i) {
76
+
77
+ // First measure the text
78
+ var textDimensions = RG.SVG.measureText({
79
+ text: key[i],
80
+ bold: prop.keyTextBold || false,
81
+ font: prop.keyTextFont || prop.textFont || defaultFont,
82
+ size: prop.keyTextSize || prop.textSize
83
+ });
84
+
85
+
86
+ RG.SVG.create({
87
+ svg: obj.svg,
88
+ type: 'rect',
89
+ parent: obj.svg.all,
90
+ attr: {
91
+ x: x + prop.keyOffsetx,
92
+ y: y - blobSize + prop.keyOffsety,
93
+ width: blobSize,
94
+ height: blobSize,
95
+ fill: colors[i]
96
+ }
97
+ });
98
+
99
+ RGraph.SVG.text({
100
+ object: obj,
101
+ parent: obj.svg.all,
102
+ size: prop.keyTextSize || prop.textSize,
103
+ bold: prop.keyTextBold || false,
104
+ font: 'Arial',
105
+ italic: prop.keyTextItalic|| false,
106
+ halign: 'left',
107
+ valign: 'bottom',
108
+ text: key[i],
109
+ x: x + blobSize + 5 + prop.keyTextOffsetx + prop.keyOffsetx,
110
+ y: y + prop.keyTextOffsety + prop.keyOffsety,
111
+ color: 'black',
112
+ background: 'white',
113
+ padding: 0
114
+ })
115
+
116
+ x += 10 + blobSize + 5 + textDimensions[0];
117
+ }
118
+ };
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+ /**
128
+ * Create a TABLE based HTML key. There's lots of options so it's
129
+ * suggested that you consult the documentation page
130
+ *
131
+ * @param mixed id This should be a string consisting of the ID of the container
132
+ * @param object prop An object map of the various properties that you can use to
133
+ * configure the key. See the documentation page for a list.
134
+ */
135
+ RG.SVG.HTML.key = function (id, prop)
136
+ {
137
+ var div = doc.getElementById(id);
138
+
139
+
140
+ /**
141
+ * Create the table that becomes the key
142
+ */
143
+ var str = '<table border="0" cellspacing="0" cellpadding="0" id="rgraph_key" style="display: inline;' + (function ()
144
+ {
145
+ var style = ''
146
+ for (i in prop.tableCss) {
147
+ if (typeof i === 'string') {
148
+ style = style + i + ': ' + prop.tableCss[i] + ';';
149
+ }
150
+ }
151
+ return style;
152
+ })() + '" ' + (prop.tableClass ? 'class="' + prop.tableClass + '"' : '') + '>';
153
+
154
+
155
+
156
+ /**
157
+ * Add the individual key elements
158
+ */
159
+ for (var i=0; i<prop.labels.length; i+=1) {
160
+ str += '<tr><td><div style="' + (function ()
161
+ {
162
+ var style = '';
163
+
164
+ for (var j in prop.blobCss) {
165
+ if (typeof j === 'string') {
166
+ style = style + j + ': ' + prop.blobCss[j] + ';';
167
+ }
168
+ }
169
+
170
+ return style;
171
+ })() + 'display: inline-block; margin-right: 5px; margin-top: 4px; width: 15px; height: 15px; background-color: ' + prop.colors[i] + '"' + (prop.blobClass ? 'class="' + prop.blobClass + '"' : '') + '>&nbsp;</div><td>' + (prop.links && prop.links[i] ? '<a href="' + prop.links[i] + '">' : '') + '<span ' + (prop.labelClass ? 'class="' + prop.labelClass + '"' : '') + '" style="' + (function ()
172
+ {
173
+ var style = '';
174
+
175
+ for (var j in prop.labelCss) {
176
+ if (typeof j === 'string') {
177
+ style = style + j + ': ' + prop.labelCss[j] + ';';
178
+ }
179
+ }
180
+
181
+ return style;
182
+ })() + '" ' + (function ()
183
+ {
184
+ var style = '';
185
+
186
+ if (prop['labelCss_' + i]) {
187
+ for (var j in prop['labelCss_' + i]) {
188
+ style = style + j + ': ' + prop['labelCss_' + i][j] + ';';
189
+ }
190
+ }
191
+
192
+ return style ? 'style="' + style + '"' : '';
193
+ })() + '>' + prop.labels[i] + '</span>' + (prop.links && prop.links[i] ? '</a>' : '') + '</td></tr>';
194
+ }
195
+
196
+ div.innerHTML += (str + '</table>');
197
+
198
+ // Return the TABLE object that is the HTML key
199
+ return doc.getElementById('rgraph_key');
200
+ };
201
+
202
+
203
+
204
+
205
+ // End module pattern
206
+ })(window, document);
@@ -1,4 +1,4 @@
1
- // version: 2017-01-02
1
+ // version: 2017-05-08
2
2
  /**
3
3
  * o--------------------------------------------------------------------------------o
4
4
  * | This file is part of the RGraph package - you can learn more at: |
@@ -1,4 +1,4 @@
1
- // version: 2017-01-02
1
+ // version: 2017-05-08
2
2
  /**
3
3
  * o--------------------------------------------------------------------------------o
4
4
  * | This file is part of the RGraph package - you can learn more at: |
@@ -42,7 +42,7 @@
42
42
  zIndex: 3,
43
43
  borderRadius: '5px',
44
44
  boxShadow: 'rgba(96,96,96,0.5) 0 0 5px',
45
- opacity: 0
45
+ transition: 'left ease-out .25s, top ease-out .25s'
46
46
  };
47
47
 
48
48
 
@@ -60,9 +60,7 @@
60
60
  RG.SVG.fireCustomEvent(obj, 'onbeforetooltip');
61
61
 
62
62
 
63
-
64
-
65
- if (RG.SVG.trim(opt.text).length === 0) {
63
+ if (!opt.text || typeof opt.text === 'undefined' || RG.SVG.trim(opt.text).length === 0) {
66
64
  return;
67
65
  }
68
66
 
@@ -81,20 +79,61 @@
81
79
 
82
80
 
83
81
 
84
- // Create the tooltip DIV element
85
- var tooltipObj = document.createElement('DIV');
86
- tooltipObj.className = prop.tooltipsCssClass;
87
82
 
88
83
 
89
84
 
90
- // Add the default CSS to the tooltip
91
- for (var i in RG.SVG.tooltips.style) {
92
- if (typeof i === 'string') {
93
- tooltipObj.style[i] = RG.SVG.tooltips.style[i];
85
+
86
+
87
+ // Create the tooltip DIV element
88
+ if (!RG.SVG.REG.get('tooltip')) {
89
+
90
+ var tooltipObj = document.createElement('DIV');
91
+ tooltipObj.className = prop.tooltipsCssClass;
92
+
93
+
94
+
95
+
96
+ // Add the default CSS to the tooltip
97
+ for (var i in RG.SVG.tooltips.style) {
98
+ if (typeof i === 'string') {
99
+ tooltipObj.style[i] = RG.SVG.tooltips.style[i];
100
+ }
94
101
  }
102
+
103
+
104
+
105
+
106
+
107
+ // Reuse an existing tooltip
108
+ } else {
109
+ var tooltipObj = RG.SVG.REG.get('tooltip');
110
+ tooltipObj.__object__.removeHighlight();
111
+
112
+ // This prevents the object from continuously growing
113
+ tooltipObj.style.width = '';
95
114
  }
96
115
 
97
116
 
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+
131
+
132
+ if (RG.SVG.REG.get('tooltip-lasty')) {
133
+ tooltipObj.style.left = RG.SVG.REG.get('tooltip-lastx') + 'px';
134
+ tooltipObj.style.top = RG.SVG.REG.get('tooltip-lasty') + 'px';
135
+ }
136
+
98
137
  tooltipObj.innerHTML = opt.text;
99
138
  tooltipObj.__text__ = opt.text; // This is set because the innerHTML can change when it's set
100
139
  tooltipObj.id = '__rgraph_tooltip_' + obj.id + '_' + obj.uid + '_'+ opt.index;
@@ -130,7 +169,7 @@
130
169
 
131
170
  var width = tooltipObj.offsetWidth,
132
171
  height = tooltipObj.offsetHeight;
133
-
172
+
134
173
  // Move the tooltip into position
135
174
  tooltipObj.style.left = opt.event.pageX - (width / 2) + 'px';
136
175
  tooltipObj.style.top = opt.event.pageY - height - 15 + 'px';
@@ -142,10 +181,9 @@
142
181
  * Set the width on the tooltip so it doesn't resize if the window is resized
143
182
  */
144
183
  tooltipObj.style.width = width + 'px';
145
-
146
-
147
- // Fade the tooltip in if the tooltip effect is "fade"
148
- if (prop.tooltipsEffect === 'fade') {
184
+
185
+ // Fade the tooltip in if the tooltip is not the first view
186
+ if (!RG.SVG.REG.get('tooltip-lastx')) {
149
187
  for (var i=0; i<=30; ++i) {
150
188
  (function (idx)
151
189
  {
@@ -155,9 +193,6 @@
155
193
  }, (idx / 30) * 200);
156
194
  })(i);
157
195
  }
158
- } else {
159
- tooltipObj.style.opacity = 1;
160
- tooltipObj.style.display = 'inline-block';
161
196
  }
162
197
 
163
198
 
@@ -202,7 +237,7 @@
202
237
  };
203
238
 
204
239
  // Cancel the click event
205
- tooltipObj.onclick = function (e)
240
+ tooltipObj.onclick = function (e)
206
241
  {
207
242
  if (e.button == 0) {
208
243
  e.stopPropagation();
@@ -210,16 +245,22 @@
210
245
  };
211
246
 
212
247
  // Add the body click handler that clears the tooltip
213
- document.body.addEventListener('mousedown', function (e)
248
+ document.body.addEventListener('mouseup', function (e)
214
249
  {
215
250
  RG.SVG.hideTooltip();
216
251
  }, false);
217
252
 
218
253
 
254
+
255
+
256
+
219
257
  /**
220
258
  * Keep a reference to the tooltip in the registry
221
259
  */
222
260
  RG.SVG.REG.set('tooltip', tooltipObj);
261
+ RG.SVG.REG.set('tooltip-lastx', parseFloat(tooltipObj.style.left));
262
+ RG.SVG.REG.set('tooltip-lasty', parseFloat(tooltipObj.style.top));
263
+
223
264
 
224
265
  //
225
266
  // Fire the tooltip event