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.
- checksums.yaml +8 -8
- data/.travis.yml +1 -0
- data/README.md +2 -2
- data/lib/rgraph-rails/version.rb +1 -1
- data/vendor/assets/images/bullet.png +0 -0
- data/vendor/assets/images/facebook-large.png +0 -0
- data/vendor/assets/images/google-plus-large.png +0 -0
- data/vendor/assets/images/logo.png +0 -0
- data/vendor/assets/images/rgraph.jpg +0 -0
- data/vendor/assets/javascripts/RGraph.bar.js +533 -242
- data/vendor/assets/javascripts/RGraph.bipolar.js +152 -169
- data/vendor/assets/javascripts/RGraph.common.annotate.js +2 -2
- data/vendor/assets/javascripts/RGraph.common.context.js +2 -2
- data/vendor/assets/javascripts/RGraph.common.core.js +688 -373
- data/vendor/assets/javascripts/RGraph.common.csv.js +2 -2
- data/vendor/assets/javascripts/RGraph.common.deprecated.js +2 -2
- data/vendor/assets/javascripts/RGraph.common.dynamic.js +188 -193
- data/vendor/assets/javascripts/RGraph.common.effects.js +62 -38
- data/vendor/assets/javascripts/RGraph.common.key.js +35 -15
- data/vendor/assets/javascripts/RGraph.common.resizing.js +38 -21
- data/vendor/assets/javascripts/RGraph.common.sheets.js +2 -2
- data/vendor/assets/javascripts/RGraph.common.tooltips.js +48 -40
- data/vendor/assets/javascripts/RGraph.common.zoom.js +2 -2
- data/vendor/assets/javascripts/RGraph.drawing.background.js +33 -49
- data/vendor/assets/javascripts/RGraph.drawing.circle.js +27 -30
- data/vendor/assets/javascripts/RGraph.drawing.image.js +23 -26
- data/vendor/assets/javascripts/RGraph.drawing.marker1.js +47 -40
- data/vendor/assets/javascripts/RGraph.drawing.marker2.js +38 -42
- data/vendor/assets/javascripts/RGraph.drawing.marker3.js +24 -28
- data/vendor/assets/javascripts/RGraph.drawing.poly.js +25 -39
- data/vendor/assets/javascripts/RGraph.drawing.rect.js +27 -32
- data/vendor/assets/javascripts/RGraph.drawing.text.js +53 -58
- data/vendor/assets/javascripts/RGraph.drawing.xaxis.js +24 -29
- data/vendor/assets/javascripts/RGraph.drawing.yaxis.js +45 -51
- data/vendor/assets/javascripts/RGraph.fuel.js +11 -9
- data/vendor/assets/javascripts/RGraph.funnel.js +40 -43
- data/vendor/assets/javascripts/RGraph.gantt.js +34 -34
- data/vendor/assets/javascripts/RGraph.gauge.js +64 -55
- data/vendor/assets/javascripts/RGraph.hbar.js +194 -137
- data/vendor/assets/javascripts/RGraph.hprogress.js +261 -167
- data/vendor/assets/javascripts/RGraph.line.js +520 -512
- data/vendor/assets/javascripts/RGraph.meter.js +11 -10
- data/vendor/assets/javascripts/RGraph.modaldialog.js +11 -2
- data/vendor/assets/javascripts/RGraph.odo.js +11 -9
- data/vendor/assets/javascripts/RGraph.pie.js +385 -100
- data/vendor/assets/javascripts/RGraph.radar.js +36 -29
- data/vendor/assets/javascripts/RGraph.rose.js +58 -41
- data/vendor/assets/javascripts/RGraph.rscatter.js +40 -36
- data/vendor/assets/javascripts/RGraph.scatter.js +441 -499
- data/vendor/assets/javascripts/RGraph.semicircularprogress.js +1015 -0
- data/vendor/assets/javascripts/RGraph.thermometer.js +37 -37
- data/vendor/assets/javascripts/RGraph.vprogress.js +285 -157
- data/vendor/assets/javascripts/RGraph.waterfall.js +62 -62
- data/vendor/assets/stylesheets/website.css +30 -16
- metadata +3 -2
@@ -1,4 +1,4 @@
|
|
1
|
-
// version: 2016-
|
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
|
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
|
@@ -91,7 +91,10 @@
|
|
91
91
|
'chart.gutter.bottom': 5,
|
92
92
|
'chart.text.size': 12,
|
93
93
|
'chart.text.color': 'black', // Does not support gradients
|
94
|
-
'chart.text.font': 'Arial',
|
94
|
+
'chart.text.font': 'Segoe UI, Arial, Verdana, sans-serif',
|
95
|
+
'chart.text.accessible': true,
|
96
|
+
'chart.text.accessible.overflow': 'visible',
|
97
|
+
'chart.text.accessible.pointerevents': false,
|
95
98
|
'chart.contextmenu': null,
|
96
99
|
'chart.annotatable': false,
|
97
100
|
'chart.annotate.color': 'black',
|
@@ -125,7 +128,8 @@
|
|
125
128
|
'chart.scale.visible': false,
|
126
129
|
'chart.scale.decimals': 0,
|
127
130
|
'chart.units.pre': '',
|
128
|
-
'chart.units.post': ''
|
131
|
+
'chart.units.post': '',
|
132
|
+
'chart.clearto': 'rgba(0,0,0,0)'
|
129
133
|
}
|
130
134
|
|
131
135
|
/**
|
@@ -155,7 +159,6 @@
|
|
155
159
|
ca = this.canvas,
|
156
160
|
co = ca.getContext('2d'),
|
157
161
|
prop = this.properties,
|
158
|
-
pa = RG.Path,
|
159
162
|
pa2 = RG.path2,
|
160
163
|
win = window,
|
161
164
|
doc = document,
|
@@ -206,10 +209,9 @@
|
|
206
209
|
|
207
210
|
|
208
211
|
// Convert uppercase letters to dot+lower case letter
|
209
|
-
name
|
210
|
-
|
211
|
-
|
212
|
-
});
|
212
|
+
while(name.match(/([A-Z])/)) {
|
213
|
+
name = name.replace(/([A-Z])/, '.' + RegExp.$1.toLowerCase());
|
214
|
+
}
|
213
215
|
|
214
216
|
|
215
217
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
// version: 2016-
|
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
|
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
|
@@ -57,11 +57,6 @@
|
|
57
57
|
this.firstDraw = true; // After the first draw this will be false
|
58
58
|
|
59
59
|
|
60
|
-
/**
|
61
|
-
* Compatibility with older browsers
|
62
|
-
*/
|
63
|
-
//RGraph.OldBrowserCompat(this.context);
|
64
|
-
|
65
60
|
|
66
61
|
// Check for support
|
67
62
|
if (!this.canvas) {
|
@@ -109,7 +104,10 @@
|
|
109
104
|
'chart.text.boxed': true,
|
110
105
|
'chart.text.halign': 'left',
|
111
106
|
'chart.text.color': 'black',
|
112
|
-
'chart.text.font': 'Arial',
|
107
|
+
'chart.text.font': 'Segoe UI, Arial, Verdana, sans-serif',
|
108
|
+
'chart.text.accessible': true,
|
109
|
+
'chart.text.accessible.overflow': 'visible',
|
110
|
+
'chart.text.accessible.pointerevents': false,
|
113
111
|
'chart.contextmenu': null,
|
114
112
|
'chart.shadow': false,
|
115
113
|
'chart.shadow.color': '#666',
|
@@ -161,10 +159,14 @@
|
|
161
159
|
'chart.zoom.action': 'zoom',
|
162
160
|
'chart.resizable': false,
|
163
161
|
'chart.events.click': null,
|
164
|
-
'chart.events.mousemove': null
|
162
|
+
'chart.events.mousemove': null,
|
163
|
+
'chart.clearto': 'rgba(0,0,0,0)'
|
165
164
|
}
|
166
165
|
|
167
166
|
// Store the data
|
167
|
+
for (var i=0; i<data.length; ++i) {
|
168
|
+
data[i] = parseFloat(data[i]);
|
169
|
+
}
|
168
170
|
this.data = data;
|
169
171
|
|
170
172
|
|
@@ -194,7 +196,6 @@
|
|
194
196
|
ca = this.canvas,
|
195
197
|
co = ca.getContext('2d'),
|
196
198
|
prop = this.properties,
|
197
|
-
pa = RG.Path,
|
198
199
|
pa2 = RG.path2,
|
199
200
|
win = window,
|
200
201
|
doc = document,
|
@@ -247,10 +248,9 @@
|
|
247
248
|
|
248
249
|
|
249
250
|
// Convert uppercase letters to dot+lower case letter
|
250
|
-
name
|
251
|
-
|
252
|
-
|
253
|
-
});
|
251
|
+
while(name.match(/([A-Z])/)) {
|
252
|
+
name = name.replace(/([A-Z])/, '.' + RegExp.$1.toLowerCase());
|
253
|
+
}
|
254
254
|
|
255
255
|
|
256
256
|
|
@@ -680,21 +680,26 @@
|
|
680
680
|
this.Highlight = function (shape)
|
681
681
|
{
|
682
682
|
if (prop['chart.tooltips.highlight']) {
|
683
|
-
|
683
|
+
|
684
|
+
if (typeof prop['chart.highlight.style'] === 'function') {
|
685
|
+
(prop['chart.highlight.style'])(shape);
|
686
|
+
return;
|
687
|
+
}
|
688
|
+
|
689
|
+
|
690
|
+
|
684
691
|
var coords = shape['coords'];
|
685
692
|
|
686
|
-
|
687
|
-
co
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
co.stroke();
|
697
|
-
co.fill();
|
693
|
+
pa2(
|
694
|
+
co,
|
695
|
+
'b m % % l % % l % % l % % c s % f %',
|
696
|
+
coords[0], coords[1],
|
697
|
+
coords[2], coords[3],
|
698
|
+
coords[4], coords[5],
|
699
|
+
coords[6], coords[7],
|
700
|
+
prop['chart.highlight.stroke'],
|
701
|
+
prop['chart.highlight.fill']
|
702
|
+
);
|
698
703
|
}
|
699
704
|
};
|
700
705
|
|
@@ -750,6 +755,7 @@
|
|
750
755
|
var coordW = x2 - x1;
|
751
756
|
var coordX = x1 + (coordW / 2);
|
752
757
|
var canvasXY = RG.getCanvasXY(ca);
|
758
|
+
var mouseXY = RG.getMouseXY(window.event);
|
753
759
|
var gutterLeft = prop['chart.gutter.left'];
|
754
760
|
var gutterTop = prop['chart.gutter.top'];
|
755
761
|
var width = tooltip.offsetWidth;
|
@@ -757,35 +763,26 @@
|
|
757
763
|
|
758
764
|
// Set the top position
|
759
765
|
tooltip.style.left = 0;
|
760
|
-
tooltip.style.top =
|
766
|
+
tooltip.style.top = window.event.pageY - height - 5 + 'px';
|
761
767
|
|
762
768
|
// By default any overflow is hidden
|
763
769
|
tooltip.style.overflow = '';
|
764
770
|
|
765
|
-
|
766
|
-
var img = new Image();
|
767
|
-
img.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAFCAYAAACjKgd3AAAARUlEQVQYV2NkQAN79+797+RkhC4M5+/bd47B2dmZEVkBCgcmgcsgbAaA9GA1BCSBbhAuA/AagmwQPgMIGgIzCD0M0AMMAEFVIAa6UQgcAAAAAElFTkSuQmCC';
|
768
|
-
img.style.position = 'absolute';
|
769
|
-
img.id = '__rgraph_tooltip_pointer__';
|
770
|
-
img.style.top = (tooltip.offsetHeight - 2) + 'px';
|
771
|
-
tooltip.appendChild(img);
|
771
|
+
|
772
772
|
|
773
773
|
// Reposition the tooltip if at the edges:
|
774
774
|
|
775
775
|
// LEFT edge
|
776
|
-
if (
|
777
|
-
tooltip.style.left =
|
778
|
-
img.style.left = ((width * 0.1) - 8.5) + 'px';
|
776
|
+
if (canvasXY[0] + mouseXY[0] - (width / 2) < 0) {
|
777
|
+
tooltip.style.left = canvasXY[0] + mouseXY[0] - (width * 0.1) + 'px';
|
779
778
|
|
780
779
|
// RIGHT edge
|
781
|
-
} else if (
|
782
|
-
tooltip.style.left = canvasXY[0] +
|
783
|
-
img.style.left = ((width * 0.9) - 8.5) + 'px';
|
780
|
+
} else if (canvasXY[0] + mouseXY[0] + (width / 2) > doc.body.offsetWidth) {
|
781
|
+
tooltip.style.left = canvasXY[0] + mouseXY[0] - (width * 0.9) + 'px';
|
784
782
|
|
785
783
|
// Default positioning - CENTERED
|
786
784
|
} else {
|
787
|
-
tooltip.style.left =
|
788
|
-
img.style.left = ((width * 0.5) - 8.5) + 'px';
|
785
|
+
tooltip.style.left = canvasXY[0] + mouseXY[0] - (width / 2) + 'px';
|
789
786
|
}
|
790
787
|
};
|
791
788
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
// version: 2016-
|
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
|
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
|
@@ -59,10 +59,6 @@
|
|
59
59
|
this.firstDraw = true; // After the first draw this will be false
|
60
60
|
|
61
61
|
|
62
|
-
/**
|
63
|
-
* Compatibility with older browsers
|
64
|
-
*/
|
65
|
-
//RGraph.OldBrowserCompat(this.context);
|
66
62
|
|
67
63
|
|
68
64
|
// Set some defaults
|
@@ -85,8 +81,11 @@
|
|
85
81
|
'chart.vbars': [],
|
86
82
|
'chart.hbars': [],
|
87
83
|
'chart.text.size': 12,
|
88
|
-
'chart.text.font': 'Arial',
|
84
|
+
'chart.text.font': 'Segoe UI, Arial, Verdana, sans-serif',
|
89
85
|
'chart.text.color': 'black',
|
86
|
+
'chart.text.accessible': true,
|
87
|
+
'chart.text.accessible.overflow': 'visible',
|
88
|
+
'chart.text.accessible.pointerevents': false,
|
90
89
|
'chart.gutter.left': 75,
|
91
90
|
'chart.gutter.right': 25,
|
92
91
|
'chart.gutter.top': 35,
|
@@ -99,7 +98,7 @@
|
|
99
98
|
'chart.labels.inbar.bgcolor': null,
|
100
99
|
'chart.labels.inbar.align': 'left',
|
101
100
|
'chart.labels.inbar.size': 10,
|
102
|
-
'chart.labels.inbar.font': 'Arial',
|
101
|
+
'chart.labels.inbar.font': 'Segoe UI, Arial, Verdana, sans-serif',
|
103
102
|
'chart.labels.inbar.above': false,
|
104
103
|
'chart.labels.percent': true,
|
105
104
|
'chart.vmargin': 2,
|
@@ -153,7 +152,8 @@
|
|
153
152
|
'chart.resize.handle.background': null,
|
154
153
|
'chart.adjustable': false,
|
155
154
|
'chart.events.click': null,
|
156
|
-
'chart.events.mousemove': null
|
155
|
+
'chart.events.mousemove': null,
|
156
|
+
'chart.clearto': 'rgba(0,0,0,0)'
|
157
157
|
}
|
158
158
|
|
159
159
|
|
@@ -162,11 +162,19 @@
|
|
162
162
|
*/
|
163
163
|
if (!data) {
|
164
164
|
alert('[GANTT] The Gantt chart event data is now supplied as the second argument to the constructor - please update your code');
|
165
|
+
} else {
|
166
|
+
// Go through the data converting relevant args to numbers
|
167
|
+
for (var i=0,idx=0; i<data.length; ++i) {
|
168
|
+
if (typeof data[i][0] === 'string') data[i][0] = parseFloat(data[i][0]);
|
169
|
+
if (typeof data[i][1] === 'string') data[i][1] = parseFloat(data[i][1]);
|
170
|
+
if (typeof data[i][2] === 'string') data[i][2] = parseFloat(data[i][2]);
|
171
|
+
if (typeof data[i][7] === 'string') data[i][7] = parseFloat(data[i][7]);
|
172
|
+
}
|
165
173
|
}
|
166
174
|
|
167
|
-
// Linearize the data (DON'T use RGraph.
|
175
|
+
// Linearize the data (DON'T use RGraph.arrayLinearize() here)
|
168
176
|
for (var i=0,idx=0; i<data.length; ++i) {
|
169
|
-
if (RGraph.
|
177
|
+
if (RGraph.isArray(this.data[i][0])) {
|
170
178
|
for (var j=0; j<this.data[i].length; ++j) {
|
171
179
|
this['$' + (idx++)] = {};
|
172
180
|
}
|
@@ -195,7 +203,6 @@
|
|
195
203
|
ca = this.canvas,
|
196
204
|
co = ca.getContext('2d'),
|
197
205
|
prop = this.properties,
|
198
|
-
pa = RG.Path,
|
199
206
|
pa2 = RG.path2,
|
200
207
|
win = window,
|
201
208
|
doc = document,
|
@@ -248,10 +255,9 @@
|
|
248
255
|
|
249
256
|
|
250
257
|
// Convert uppercase letters to dot+lower case letter
|
251
|
-
name
|
252
|
-
|
253
|
-
|
254
|
-
});
|
258
|
+
while(name.match(/([A-Z])/)) {
|
259
|
+
name = name.replace(/([A-Z])/, '.' + RegExp.$1.toLowerCase());
|
260
|
+
}
|
255
261
|
|
256
262
|
if (name == 'chart.margin') {
|
257
263
|
name = 'chart.vmargin'
|
@@ -765,8 +771,11 @@
|
|
765
771
|
this.highlight =
|
766
772
|
this.Highlight = function (shape)
|
767
773
|
{
|
768
|
-
|
769
|
-
|
774
|
+
if (typeof prop['chart.highlight.style'] === 'function') {
|
775
|
+
(prop['chart.highlight.style'])(shape);
|
776
|
+
} else {
|
777
|
+
RG.Highlight.Rect(this, shape);
|
778
|
+
}
|
770
779
|
};
|
771
780
|
|
772
781
|
|
@@ -887,38 +896,29 @@
|
|
887
896
|
var gutterTop = obj.gutterTop;
|
888
897
|
var width = tooltip.offsetWidth;
|
889
898
|
var height = tooltip.offsetHeight;
|
899
|
+
var mouseXY = RG.getMouseXY(window.event);
|
890
900
|
|
891
901
|
// Set the top position
|
892
902
|
tooltip.style.left = 0;
|
893
|
-
tooltip.style.top =
|
903
|
+
tooltip.style.top = window.event.pageY - height - 5 + 'px';
|
894
904
|
|
895
905
|
// By default any overflow is hidden
|
896
906
|
tooltip.style.overflow = '';
|
897
907
|
|
898
|
-
// The arrow
|
899
|
-
var img = new Image();
|
900
|
-
img.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAFCAYAAACjKgd3AAAARUlEQVQYV2NkQAN79+797+RkhC4M5+/bd47B2dmZEVkBCgcmgcsgbAaA9GA1BCSBbhAuA/AagmwQPgMIGgIzCD0M0AMMAEFVIAa6UQgcAAAAAElFTkSuQmCC';
|
901
|
-
img.style.position = 'absolute';
|
902
|
-
img.id = '__rgraph_tooltip_pointer__';
|
903
|
-
img.style.top = (tooltip.offsetHeight - 2) + 'px';
|
904
|
-
tooltip.appendChild(img);
|
905
908
|
|
906
909
|
// Reposition the tooltip if at the edges:
|
907
910
|
|
908
911
|
// LEFT edge
|
909
|
-
if (
|
910
|
-
tooltip.style.left =
|
911
|
-
img.style.left = ((width * 0.1) - 8.5) + 'px';
|
912
|
+
if (canvasXY[0] + mouseXY[0] - (width / 2) < 0) {
|
913
|
+
tooltip.style.left = canvasXY[0] + mouseXY[0] - (width * 0.1) + 'px';
|
912
914
|
|
913
915
|
// RIGHT edge
|
914
|
-
} else if (
|
915
|
-
tooltip.style.left = canvasXY[0] +
|
916
|
-
img.style.left = ((width * 0.9) - 8.5) + 'px';
|
916
|
+
} else if (canvasXY[0] + mouseXY[0] + (width / 2) > doc.body.offsetWidth) {
|
917
|
+
tooltip.style.left = canvasXY[0] + mouseXY[0] - (width * 0.9) + 'px';
|
917
918
|
|
918
919
|
// Default positioning - CENTERED
|
919
920
|
} else {
|
920
|
-
tooltip.style.left =
|
921
|
-
img.style.left = ((width * 0.5) - 8.5) + 'px';
|
921
|
+
tooltip.style.left = canvasXY[0] + mouseXY[0] - (width / 2) + 'px';
|
922
922
|
}
|
923
923
|
};
|
924
924
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
// version: 2016-
|
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
|
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,20 +99,23 @@
|
|
99
99
|
'chart.gutter.bottom': 15,
|
100
100
|
'chart.border.width': 10,
|
101
101
|
'chart.title.top': '',
|
102
|
-
'chart.title.top.font':'Arial',
|
102
|
+
'chart.title.top.font':'Segoe UI, Arial, Verdana, sans-serif',
|
103
103
|
'chart.title.top.size':14,
|
104
104
|
'chart.title.top.color':'#333',
|
105
105
|
'chart.title.top.bold':false,
|
106
106
|
'chart.title.top.pos': null,
|
107
107
|
'chart.title.bottom': '',
|
108
|
-
'chart.title.bottom.font':'Arial',
|
108
|
+
'chart.title.bottom.font':'Segoe UI, Arial, Verdana, sans-serif',
|
109
109
|
'chart.title.bottom.size':14,
|
110
110
|
'chart.title.bottom.color':'#333',
|
111
111
|
'chart.title.bottom.bold':false,
|
112
112
|
'chart.title.bottom.pos':null,
|
113
|
-
'chart.text.font': 'Arial',
|
113
|
+
'chart.text.font': 'Segoe UI, Arial, Verdana, sans-serif',
|
114
114
|
'chart.text.color': '#666',
|
115
115
|
'chart.text.size': 12,
|
116
|
+
'chart.text.accessible': true,
|
117
|
+
'chart.text.accessible.overflow': 'visible',
|
118
|
+
'chart.text.accessible.pointerevents': false,
|
116
119
|
'chart.background.color': 'white',
|
117
120
|
'chart.background.gradient': false,
|
118
121
|
'chart.scale.decimals': 0,
|
@@ -132,14 +135,18 @@
|
|
132
135
|
|
133
136
|
'chart.red.start': 0.9 * this.max,
|
134
137
|
'chart.red.color': '#DC3912',
|
138
|
+
'chart.red.width': 10,
|
135
139
|
'chart.yellow.color': '#FF9900',
|
140
|
+
'chart.yellow.width': 10,
|
136
141
|
'chart.green.end': 0.7 * this.max,
|
137
142
|
'chart.green.color': 'rgba(0,0,0,0)',
|
143
|
+
'chart.green.width': 10,
|
138
144
|
'chart.colors.ranges': null,
|
139
145
|
'chart.needle.size': null,
|
140
146
|
'chart.needle.tail': false,
|
141
147
|
'chart.needle.colors': ['#D5604D', 'red', 'green', 'yellow'],
|
142
148
|
'chart.needle.type': 'triangle',
|
149
|
+
'chart.needle.width': 7,
|
143
150
|
'chart.border.outer': '#ccc',
|
144
151
|
'chart.border.inner': '#f1f1f1',
|
145
152
|
'chart.border.outline': 'black',
|
@@ -162,7 +169,8 @@
|
|
162
169
|
'chart.shadow.color': 'gray',
|
163
170
|
'chart.shadow.offsetx': 0,
|
164
171
|
'chart.shadow.offsety': 0,
|
165
|
-
'chart.shadow.blur': 15
|
172
|
+
'chart.shadow.blur': 15,
|
173
|
+
'chart.clearto': 'rgba(0,0,0,0)'
|
166
174
|
}
|
167
175
|
|
168
176
|
|
@@ -187,7 +195,6 @@
|
|
187
195
|
ca = this.canvas,
|
188
196
|
co = ca.getContext('2d'),
|
189
197
|
prop = this.properties,
|
190
|
-
pa = RG.Path,
|
191
198
|
pa2 = RG.path2,
|
192
199
|
win = window,
|
193
200
|
doc = document,
|
@@ -240,10 +247,9 @@
|
|
240
247
|
|
241
248
|
|
242
249
|
// Convert uppercase letters to dot+lower case letter
|
243
|
-
name
|
244
|
-
|
245
|
-
|
246
|
-
});
|
250
|
+
while(name.match(/([A-Z])/)) {
|
251
|
+
name = name.replace(/([A-Z])/, '.' + RegExp.$1.toLowerCase());
|
252
|
+
}
|
247
253
|
|
248
254
|
|
249
255
|
|
@@ -664,47 +670,50 @@
|
|
664
670
|
var font = prop['chart.text.font'];
|
665
671
|
var size = prop['chart.text.size'];
|
666
672
|
var num = prop['chart.labels.specific'] ? (prop['chart.labels.specific'].length - 1) : prop['chart.labels.count'];
|
667
|
-
|
673
|
+
|
668
674
|
co.beginPath();
|
669
|
-
|
670
|
-
var
|
671
|
-
|
672
|
-
a = this.
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
675
|
+
if (num) {
|
676
|
+
for (var i=0; i<=num; ++i) {
|
677
|
+
var hyp = (this.radius - 25 - prop['chart.border.width']) - prop['chart.labels.offset'];
|
678
|
+
var a = (this.endAngle - this.startAngle) / num
|
679
|
+
a = this.startAngle + (i * a);
|
680
|
+
a -= RG.HALFPI;
|
681
|
+
|
682
|
+
var x = this.centerx - (ma.sin(a) * hyp);
|
683
|
+
var y = this.centery + (ma.cos(a) * hyp);
|
684
|
+
|
685
|
+
var hAlign = x > this.centerx ? 'right' : 'left';
|
686
|
+
var vAlign = y > this.centery ? 'bottom' : 'top';
|
687
|
+
|
688
|
+
// This handles the label alignment when the label is on a PI/HALFPI boundary
|
689
|
+
if (a == RG.HALFPI) {
|
690
|
+
vAlign = 'center';
|
691
|
+
} else if (a == RG.PI) {
|
692
|
+
hAlign = 'center';
|
693
|
+
} else if (a == (RG.HALFPI + RG.PI) ) {
|
694
|
+
vAlign = 'center';
|
695
|
+
}
|
696
|
+
|
697
|
+
/**
|
698
|
+
* Can now force center alignment
|
699
|
+
*/
|
700
|
+
if (prop['chart.labels.centered']) {
|
701
|
+
hAlign = 'center';
|
702
|
+
vAlign = 'center';
|
703
|
+
}
|
704
|
+
|
705
|
+
|
706
|
+
RG.Text2(this, {
|
707
|
+
'font':font,
|
708
|
+
'size':size,
|
709
|
+
'x':x,
|
710
|
+
'y':y,
|
711
|
+
'text':prop['chart.labels.specific'] ? prop['chart.labels.specific'][i] : RG.number_format(this, (((this.max - this.min) * (i / num)) + this.min).toFixed(prop['chart.scale.decimals']), prop['chart.units.pre'], prop['chart.units.post']),
|
712
|
+
'halign':hAlign,
|
713
|
+
'valign':vAlign,
|
714
|
+
'tag': prop['chart.labels.specific'] ? 'labels.specific' : 'labels'
|
715
|
+
});
|
696
716
|
}
|
697
|
-
|
698
|
-
|
699
|
-
RG.Text2(this, {'font':font,
|
700
|
-
'size':size,
|
701
|
-
'x':x,
|
702
|
-
'y':y,
|
703
|
-
'text':prop['chart.labels.specific'] ? prop['chart.labels.specific'][i] : RG.number_format(this, (((this.max - this.min) * (i / num)) + this.min).toFixed(prop['chart.scale.decimals']), prop['chart.units.pre'], prop['chart.units.post']),
|
704
|
-
'halign':hAlign,
|
705
|
-
'valign':vAlign,
|
706
|
-
'tag': prop['chart.labels.specific'] ? 'labels.specific' : 'labels'
|
707
|
-
});
|
708
717
|
}
|
709
718
|
co.fill();
|
710
719
|
|
@@ -731,7 +740,7 @@
|
|
731
740
|
'size':size + 2,
|
732
741
|
'x':x,
|
733
742
|
'y':y,
|
734
|
-
'text':RG.
|
743
|
+
'text':RG.numberFormat(this, this.value.toFixed(prop['chart.value.text.decimals']), units_pre, units_post),
|
735
744
|
'halign':'center',
|
736
745
|
'valign':'center',
|
737
746
|
'bounding':bounding,
|
@@ -848,7 +857,7 @@
|
|
848
857
|
|
849
858
|
co.beginPath();
|
850
859
|
|
851
|
-
co.lineWidth =
|
860
|
+
co.lineWidth = prop['chart.needle.width'];
|
852
861
|
co.strokeStyle = color;
|
853
862
|
|
854
863
|
co.arc(this.centerx,
|
@@ -944,7 +953,7 @@
|
|
944
953
|
|
945
954
|
co.beginPath();
|
946
955
|
co.arc(this.centerx, this.centery, this.radius - 10 - prop['chart.border.width'], greenStart, greenEnd, false);
|
947
|
-
co.arc(this.centerx, this.centery, this.radius -
|
956
|
+
co.arc(this.centerx, this.centery, this.radius - (10 + prop['chart.green.width']) - prop['chart.border.width'], greenEnd, greenStart, true);
|
948
957
|
co.fill();
|
949
958
|
|
950
959
|
|
@@ -962,7 +971,7 @@
|
|
962
971
|
|
963
972
|
co.beginPath();
|
964
973
|
co.arc(this.centerx, this.centery, this.radius - 10 - prop['chart.border.width'], yellowStart, yellowEnd, false);
|
965
|
-
co.arc(this.centerx, this.centery, this.radius -
|
974
|
+
co.arc(this.centerx, this.centery, this.radius - (10 + prop['chart.yellow.width']) - prop['chart.border.width'], yellowEnd, yellowStart, true);
|
966
975
|
co.fill();
|
967
976
|
|
968
977
|
|
@@ -980,7 +989,7 @@
|
|
980
989
|
|
981
990
|
co.beginPath();
|
982
991
|
co.arc(this.centerx, this.centery, this.radius - 10 - prop['chart.border.width'], redStart, redEnd, false);
|
983
|
-
co.arc(this.centerx, this.centery, this.radius -
|
992
|
+
co.arc(this.centerx, this.centery, this.radius - (10 + prop['chart.red.width']) - prop['chart.border.width'], redEnd, redStart, true);
|
984
993
|
co.fill();
|
985
994
|
};
|
986
995
|
|