rgraph-rails 5.00 → 6.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/publish-geml.yaml +46 -0
- data/.gitignore +1 -0
- data/README.md +4 -5
- data/lib/rgraph-rails/version.rb +1 -1
- data/rgraph-rails.gemspec +4 -4
- data/vendor/assets/javascripts/RGraph.activity.js +1691 -0
- data/vendor/assets/javascripts/RGraph.bar.js +4253 -236
- data/vendor/assets/javascripts/RGraph.bipolar.js +3958 -162
- data/vendor/assets/javascripts/RGraph.common.annotate.js +414 -35
- data/vendor/assets/javascripts/RGraph.common.context.js +635 -30
- data/vendor/assets/javascripts/RGraph.common.core.js +10485 -419
- data/vendor/assets/javascripts/RGraph.common.csv.js +508 -27
- data/vendor/assets/javascripts/RGraph.common.dynamic.js +1693 -90
- data/vendor/assets/javascripts/RGraph.common.effects.js +1629 -89
- data/vendor/assets/javascripts/RGraph.common.key.js +1003 -53
- data/vendor/assets/javascripts/RGraph.common.moment.js +5670 -0
- data/vendor/assets/javascripts/RGraph.common.sheets.js +541 -31
- data/vendor/assets/javascripts/RGraph.common.sheets.php +351 -0
- data/vendor/assets/javascripts/RGraph.common.starburst.js +382 -0
- data/vendor/assets/javascripts/RGraph.common.table.js +386 -0
- data/vendor/assets/javascripts/RGraph.common.tooltips.js +1433 -32
- data/vendor/assets/javascripts/RGraph.drawing.background.js +660 -35
- data/vendor/assets/javascripts/RGraph.drawing.circle.js +618 -34
- data/vendor/assets/javascripts/RGraph.drawing.image.js +857 -52
- data/vendor/assets/javascripts/RGraph.drawing.line.js +712 -0
- data/vendor/assets/javascripts/RGraph.drawing.marker1.js +760 -38
- data/vendor/assets/javascripts/RGraph.drawing.marker2.js +740 -37
- data/vendor/assets/javascripts/RGraph.drawing.marker3.js +573 -36
- data/vendor/assets/javascripts/RGraph.drawing.poly.js +667 -36
- data/vendor/assets/javascripts/RGraph.drawing.rect.js +638 -34
- data/vendor/assets/javascripts/RGraph.drawing.text.js +672 -37
- data/vendor/assets/javascripts/RGraph.drawing.xaxis.js +653 -52
- data/vendor/assets/javascripts/RGraph.drawing.yaxis.js +714 -51
- data/vendor/assets/javascripts/RGraph.fuel.js +1149 -59
- data/vendor/assets/javascripts/RGraph.funnel.js +1277 -56
- data/vendor/assets/javascripts/RGraph.gantt.js +1646 -82
- data/vendor/assets/javascripts/RGraph.gauge.js +1773 -89
- data/vendor/assets/javascripts/RGraph.hbar.js +3869 -159
- data/vendor/assets/javascripts/RGraph.horseshoe.js +970 -0
- data/vendor/assets/javascripts/RGraph.hprogress.js +1829 -81
- data/vendor/assets/javascripts/RGraph.line.js +5293 -244
- data/vendor/assets/javascripts/RGraph.meter.js +1570 -77
- data/vendor/assets/javascripts/RGraph.modaldialog.js +300 -19
- data/vendor/assets/javascripts/RGraph.odo.js +1553 -68
- data/vendor/assets/javascripts/RGraph.pie.js +3273 -129
- data/vendor/assets/javascripts/RGraph.radar.js +2333 -108
- data/vendor/assets/javascripts/RGraph.rose.js +2685 -114
- data/vendor/assets/javascripts/RGraph.rscatter.js +1920 -80
- data/vendor/assets/javascripts/RGraph.scatter.js +4215 -171
- data/vendor/assets/javascripts/RGraph.segmented.js +1006 -0
- data/vendor/assets/javascripts/RGraph.semicircularprogress.js +1980 -59
- data/vendor/assets/javascripts/RGraph.svg.activity.js +1696 -0
- data/vendor/assets/javascripts/RGraph.svg.bar.js +2575 -77
- data/vendor/assets/javascripts/RGraph.svg.bipolar.js +3533 -106
- data/vendor/assets/javascripts/RGraph.svg.common.ajax.js +240 -21
- data/vendor/assets/javascripts/RGraph.svg.common.core.js +7105 -299
- data/vendor/assets/javascripts/RGraph.svg.common.csv.js +408 -28
- data/vendor/assets/javascripts/RGraph.svg.common.fx.js +1291 -68
- data/vendor/assets/javascripts/RGraph.svg.common.key.js +451 -20
- data/vendor/assets/javascripts/RGraph.svg.common.sheets.js +543 -31
- data/vendor/assets/javascripts/RGraph.svg.common.table.js +391 -0
- data/vendor/assets/javascripts/RGraph.svg.common.tooltips.js +1072 -23
- data/vendor/assets/javascripts/RGraph.svg.funnel.js +1151 -32
- data/vendor/assets/javascripts/RGraph.svg.gauge.js +1429 -34
- data/vendor/assets/javascripts/RGraph.svg.hbar.js +2692 -65
- data/vendor/assets/javascripts/RGraph.svg.horseshoe.js +969 -0
- data/vendor/assets/javascripts/RGraph.svg.line.js +2855 -86
- data/vendor/assets/javascripts/RGraph.svg.pie.js +1630 -58
- data/vendor/assets/javascripts/RGraph.svg.radar.js +1772 -58
- data/vendor/assets/javascripts/RGraph.svg.rose.js +2419 -83
- data/vendor/assets/javascripts/RGraph.svg.scatter.js +2280 -65
- data/vendor/assets/javascripts/RGraph.svg.segmented.js +930 -0
- data/vendor/assets/javascripts/RGraph.svg.semicircularprogress.js +1612 -29
- data/vendor/assets/javascripts/RGraph.svg.waterfall.js +1525 -50
- data/vendor/assets/javascripts/RGraph.thermometer.js +1411 -64
- data/vendor/assets/javascripts/RGraph.vprogress.js +1915 -81
- data/vendor/assets/javascripts/RGraph.waterfall.js +1896 -89
- data/vendor/assets/javascripts/financial-data.js +1067 -0
- metadata +37 -16
- data/.travis.yml +0 -11
- data/vendor/assets/javascripts/RGraph.common.deprecated.js +0 -35
- data/vendor/assets/javascripts/RGraph.common.resizing.js +0 -38
- data/vendor/assets/javascripts/RGraph.common.zoom.js +0 -15
- data/vendor/assets/javascripts/RGraph.cornergauge.js +0 -71
metadata
CHANGED
@@ -1,71 +1,83 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rgraph-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '
|
4
|
+
version: '6.14'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Griffin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '7.1'
|
17
20
|
- - ">="
|
18
21
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
22
|
+
version: 7.1.2
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '7.1'
|
24
30
|
- - ">="
|
25
31
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
32
|
+
version: 7.1.2
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: bundler
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
30
36
|
requirements:
|
31
37
|
- - "~>"
|
32
38
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
39
|
+
version: '2.4'
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 2.4.22
|
34
43
|
type: :development
|
35
44
|
prerelease: false
|
36
45
|
version_requirements: !ruby/object:Gem::Requirement
|
37
46
|
requirements:
|
38
47
|
- - "~>"
|
39
48
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
49
|
+
version: '2.4'
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: 2.4.22
|
41
53
|
- !ruby/object:Gem::Dependency
|
42
54
|
name: rake
|
43
55
|
requirement: !ruby/object:Gem::Requirement
|
44
56
|
requirements:
|
45
57
|
- - "~>"
|
46
58
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
59
|
+
version: '13.1'
|
48
60
|
type: :development
|
49
61
|
prerelease: false
|
50
62
|
version_requirements: !ruby/object:Gem::Requirement
|
51
63
|
requirements:
|
52
64
|
- - "~>"
|
53
65
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
66
|
+
version: '13.1'
|
55
67
|
- !ruby/object:Gem::Dependency
|
56
68
|
name: rspec
|
57
69
|
requirement: !ruby/object:Gem::Requirement
|
58
70
|
requirements:
|
59
71
|
- - "~>"
|
60
72
|
- !ruby/object:Gem::Version
|
61
|
-
version: '3.
|
73
|
+
version: '3.12'
|
62
74
|
type: :development
|
63
75
|
prerelease: false
|
64
76
|
version_requirements: !ruby/object:Gem::Requirement
|
65
77
|
requirements:
|
66
78
|
- - "~>"
|
67
79
|
- !ruby/object:Gem::Version
|
68
|
-
version: '3.
|
80
|
+
version: '3.12'
|
69
81
|
description: " The rgraph (http://www.rgraph.net/) interactive chart/graph library
|
70
82
|
with the Rails asset pipeline. "
|
71
83
|
email:
|
@@ -74,9 +86,9 @@ executables: []
|
|
74
86
|
extensions: []
|
75
87
|
extra_rdoc_files: []
|
76
88
|
files:
|
89
|
+
- ".github/workflows/publish-geml.yaml"
|
77
90
|
- ".gitignore"
|
78
91
|
- ".rspec"
|
79
|
-
- ".travis.yml"
|
80
92
|
- CODE_OF_CONDUCT.md
|
81
93
|
- Gemfile
|
82
94
|
- README.md
|
@@ -87,24 +99,26 @@ files:
|
|
87
99
|
- lib/rgraph-rails/version.rb
|
88
100
|
- license.txt
|
89
101
|
- rgraph-rails.gemspec
|
102
|
+
- vendor/assets/javascripts/RGraph.activity.js
|
90
103
|
- vendor/assets/javascripts/RGraph.bar.js
|
91
104
|
- vendor/assets/javascripts/RGraph.bipolar.js
|
92
105
|
- vendor/assets/javascripts/RGraph.common.annotate.js
|
93
106
|
- vendor/assets/javascripts/RGraph.common.context.js
|
94
107
|
- vendor/assets/javascripts/RGraph.common.core.js
|
95
108
|
- vendor/assets/javascripts/RGraph.common.csv.js
|
96
|
-
- vendor/assets/javascripts/RGraph.common.deprecated.js
|
97
109
|
- vendor/assets/javascripts/RGraph.common.dynamic.js
|
98
110
|
- vendor/assets/javascripts/RGraph.common.effects.js
|
99
111
|
- vendor/assets/javascripts/RGraph.common.key.js
|
100
|
-
- vendor/assets/javascripts/RGraph.common.
|
112
|
+
- vendor/assets/javascripts/RGraph.common.moment.js
|
101
113
|
- vendor/assets/javascripts/RGraph.common.sheets.js
|
114
|
+
- vendor/assets/javascripts/RGraph.common.sheets.php
|
115
|
+
- vendor/assets/javascripts/RGraph.common.starburst.js
|
116
|
+
- vendor/assets/javascripts/RGraph.common.table.js
|
102
117
|
- vendor/assets/javascripts/RGraph.common.tooltips.js
|
103
|
-
- vendor/assets/javascripts/RGraph.common.zoom.js
|
104
|
-
- vendor/assets/javascripts/RGraph.cornergauge.js
|
105
118
|
- vendor/assets/javascripts/RGraph.drawing.background.js
|
106
119
|
- vendor/assets/javascripts/RGraph.drawing.circle.js
|
107
120
|
- vendor/assets/javascripts/RGraph.drawing.image.js
|
121
|
+
- vendor/assets/javascripts/RGraph.drawing.line.js
|
108
122
|
- vendor/assets/javascripts/RGraph.drawing.marker1.js
|
109
123
|
- vendor/assets/javascripts/RGraph.drawing.marker2.js
|
110
124
|
- vendor/assets/javascripts/RGraph.drawing.marker3.js
|
@@ -118,6 +132,7 @@ files:
|
|
118
132
|
- vendor/assets/javascripts/RGraph.gantt.js
|
119
133
|
- vendor/assets/javascripts/RGraph.gauge.js
|
120
134
|
- vendor/assets/javascripts/RGraph.hbar.js
|
135
|
+
- vendor/assets/javascripts/RGraph.horseshoe.js
|
121
136
|
- vendor/assets/javascripts/RGraph.hprogress.js
|
122
137
|
- vendor/assets/javascripts/RGraph.line.js
|
123
138
|
- vendor/assets/javascripts/RGraph.meter.js
|
@@ -128,7 +143,9 @@ files:
|
|
128
143
|
- vendor/assets/javascripts/RGraph.rose.js
|
129
144
|
- vendor/assets/javascripts/RGraph.rscatter.js
|
130
145
|
- vendor/assets/javascripts/RGraph.scatter.js
|
146
|
+
- vendor/assets/javascripts/RGraph.segmented.js
|
131
147
|
- vendor/assets/javascripts/RGraph.semicircularprogress.js
|
148
|
+
- vendor/assets/javascripts/RGraph.svg.activity.js
|
132
149
|
- vendor/assets/javascripts/RGraph.svg.bar.js
|
133
150
|
- vendor/assets/javascripts/RGraph.svg.bipolar.js
|
134
151
|
- vendor/assets/javascripts/RGraph.svg.common.ajax.js
|
@@ -137,20 +154,24 @@ files:
|
|
137
154
|
- vendor/assets/javascripts/RGraph.svg.common.fx.js
|
138
155
|
- vendor/assets/javascripts/RGraph.svg.common.key.js
|
139
156
|
- vendor/assets/javascripts/RGraph.svg.common.sheets.js
|
157
|
+
- vendor/assets/javascripts/RGraph.svg.common.table.js
|
140
158
|
- vendor/assets/javascripts/RGraph.svg.common.tooltips.js
|
141
159
|
- vendor/assets/javascripts/RGraph.svg.funnel.js
|
142
160
|
- vendor/assets/javascripts/RGraph.svg.gauge.js
|
143
161
|
- vendor/assets/javascripts/RGraph.svg.hbar.js
|
162
|
+
- vendor/assets/javascripts/RGraph.svg.horseshoe.js
|
144
163
|
- vendor/assets/javascripts/RGraph.svg.line.js
|
145
164
|
- vendor/assets/javascripts/RGraph.svg.pie.js
|
146
165
|
- vendor/assets/javascripts/RGraph.svg.radar.js
|
147
166
|
- vendor/assets/javascripts/RGraph.svg.rose.js
|
148
167
|
- vendor/assets/javascripts/RGraph.svg.scatter.js
|
168
|
+
- vendor/assets/javascripts/RGraph.svg.segmented.js
|
149
169
|
- vendor/assets/javascripts/RGraph.svg.semicircularprogress.js
|
150
170
|
- vendor/assets/javascripts/RGraph.svg.waterfall.js
|
151
171
|
- vendor/assets/javascripts/RGraph.thermometer.js
|
152
172
|
- vendor/assets/javascripts/RGraph.vprogress.js
|
153
173
|
- vendor/assets/javascripts/RGraph.waterfall.js
|
174
|
+
- vendor/assets/javascripts/financial-data.js
|
154
175
|
homepage: https://github.com/dsgriffin/rgraph-rails
|
155
176
|
licenses:
|
156
177
|
- GPL-3.0
|
@@ -170,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
170
191
|
- !ruby/object:Gem::Version
|
171
192
|
version: '0'
|
172
193
|
requirements: []
|
173
|
-
rubygems_version: 3.
|
194
|
+
rubygems_version: 3.1.6
|
174
195
|
signing_key:
|
175
196
|
specification_version: 4
|
176
197
|
summary: The rgraph (http://www.rgraph.net/) interactive chart/graph library with
|
data/.travis.yml
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
rvm:
|
3
|
-
- 2.3.0
|
4
|
-
before_install: gem install bundler -v 1.10.6
|
5
|
-
deploy:
|
6
|
-
provider: rubygems
|
7
|
-
api_key:
|
8
|
-
secure: afUjE//0Dbsz5hq99BS5MAq4mS5m+ZQws9nsUTUXr9I1UQud0sng4/0KsCZJkmJeGmmagWPAOJ4uZF5gnl0STmnYVRavLYwjIZ8pesTeh+wofGIXwhuE2T3JzGLlX9NADNk0tm67wWMztTOiZUMtWHjrfApahoH3NO8EblwBd0PrwghNIP3bq8xS5X5FOi02Om+SxD3Px/JFiLHePejiLc4T1Uw2rX2fy3buy0XKz08tLZ0tKVs16vASR8AfsiW2vDLdJ655bv0x4JaDROyIRn+hPr+5xt2OO+HLLK/kEfQDINXrsUve7BOW0zxGEUnjIwDMtBgfkUvPG1yz7yVOQvz585TQ7w/pxRCZ0JfLxv+DVaCVwk9EyAKFFo6oM+i1cWThQiaxy0TPyZV8a/ffhuTcbMzdJbTKeTXmGooY2DuDIEmZ4ldVltVkoy+3mzMTnHyLn4t69M2jEw27Frn/gE/lwMIbgPHaXDkFGqQDT8NYqT3P9KzigRPlq6wrmoCpo8wwwCqENk7iwE0JPtrhgQA4UcmJN1bhwpjIv7S8URj2Ltn/NBxDsxPtLCs6EFUgJ2KRAuK7MGGfGQgJmO0yF6n+OvCji+eFcw+FwKBDspAqo8Y4jBBfrvajSt23KUp6kaw41UGdoTzRqdPXA9RMV16aVBBrk7SLXYm19Zl0+1I=
|
9
|
-
on:
|
10
|
-
branch: master
|
11
|
-
tags: true
|
@@ -1,35 +0,0 @@
|
|
1
|
-
|
2
|
-
RGraph=window.RGraph||{isRGraph:true};(function(win,doc,undefined)
|
3
|
-
{var RG=RGraph,ua=navigator.userAgent,ma=Math;RG.text=RG.Text=function(context,font,size,x,y,text)
|
4
|
-
{var args=arguments;if((typeof(text)!='string'&&typeof(text)!='number')||text=='undefined'){return;}
|
5
|
-
if(typeof(text)=='string'&&text.match(/\r\n/)){var dimensions=RGraph.MeasureText('M',args[11],font,size);var arr=text.split('\r\n');if(args[6]&&args[6]=='center')y=(y-(dimensions[1]*((arr.length-1)/2)));for(var i=1;i<arr.length;++i){RGraph.Text(context,font,size,args[9]==-90?(x+(size*1.5)):x,y+(dimensions[1]*i),arr[i],args[6]?args[6]:null,args[7],args[8],args[9],args[10],args[11],args[12]);}
|
6
|
-
text=arr[0];}
|
7
|
-
context.font=(args[11]?'Bold ':'')+size+'pt '+font;var i;var origX=x;var origY=y;var originalFillStyle=context.fillStyle;var originalLineWidth=context.lineWidth;if(typeof(args[6])=='undefined')args[6]='bottom';if(typeof(args[7])=='undefined')args[7]='left';if(typeof(args[8])=='undefined')args[8]=null;if(typeof(args[9])=='undefined')args[9]=0;if(navigator.userAgent.indexOf('Opera')!=-1){context.canvas.__rgraph_valign__=args[6];context.canvas.__rgraph_halign__=args[7];}
|
8
|
-
context.save();context.canvas.__rgraph_originalx__=x;context.canvas.__rgraph_originaly__=y;context.translate(x,y);x=0;y=0;if(args[9]){context.rotate(args[9]/(180/RGraph.PI));}
|
9
|
-
if(args[6]){var vAlign=args[6];if(vAlign=='center'){context.textBaseline='middle';}else if(vAlign=='top'){context.textBaseline='top';}}
|
10
|
-
if(args[7]){var hAlign=args[7];var width=context.measureText(text).width;if(hAlign){if(hAlign=='center'){context.textAlign='center';}else if(hAlign=='right'){context.textAlign='right';}}}
|
11
|
-
context.fillStyle=originalFillStyle;context.save();context.fillText(text,0,0);context.lineWidth=1;var width=context.measureText(text).width;var width_offset=(hAlign=='center'?(width/2):(hAlign=='right'?width:0));var height=size*1.5;var height_offset=(vAlign=='center'?(height/2):(vAlign=='top'?height:0));var ieOffset=0;if(args[8]){context.strokeRect(-3-width_offset,0-3-height-ieOffset+height_offset,width+6,height+6);if(args[10]){context.fillStyle=args[10];context.fillRect(-3-width_offset,0-3-height-ieOffset+height_offset,width+6,height+6);}
|
12
|
-
context.fillStyle=originalFillStyle;context.fillText(text,0,0);}
|
13
|
-
context.restore();context.lineWidth=originalLineWidth;context.restore();};RG.getMouseXY=function(e)
|
14
|
-
{var el=e.target;var x;var y;var paddingLeft=el.style.paddingLeft?parseInt(el.style.paddingLeft):0;var paddingTop=el.style.paddingTop?parseInt(el.style.paddingTop):0;var borderLeft=el.style.borderLeftWidth?parseInt(el.style.borderLeftWidth):0;var borderTop=el.style.borderTopWidth?parseInt(el.style.borderTopWidth):0;if(RGraph.ISIE8)e=event;if(typeof(e.offsetX)=='number'&&typeof(e.offsetY)=='number'){x=e.offsetX;y=e.offsetY;}else{x=0;y=0;while(el!=document.body&&el){x+=el.offsetLeft;y+=el.offsetTop;el=el.offsetParent;}
|
15
|
-
x=e.pageX-x;y=e.pageY-y;}
|
16
|
-
return[x,y];};RG.oldBrowserCompat=RG.OldBrowserCompat=function(co)
|
17
|
-
{if(!co){return;}
|
18
|
-
if(!co.measureText){co.measureText=function(text)
|
19
|
-
{var textObj=document.createElement('DIV');textObj.innerHTML=text;textObj.style.position='absolute';textObj.style.top='-100px';textObj.style.left=0;document.body.appendChild(textObj);var width={width:textObj.offsetWidth};textObj.style.display='none';return width;}}
|
20
|
-
if(!co.fillText){co.fillText=function(text,targetX,targetY)
|
21
|
-
{return false;}}
|
22
|
-
if(!co.canvas.addEventListener){window.addEventListener=function(ev,func,bubble)
|
23
|
-
{return this.attachEvent('on'+ev,func);}
|
24
|
-
co.canvas.addEventListener=function(ev,func,bubble)
|
25
|
-
{return this.attachEvent('on'+ev,func);}}};RG.each=function(arr,func)
|
26
|
-
{for(var i=0,len=arr.length;i<len;i+=1){if(typeof arguments[2]!=='undefined'){var ret=func.call(arguments[2],i,arr[i]);}else{var ret=func.call(arr,i,arr[i]);}
|
27
|
-
if(ret===false){return;}}};RG.getHeight=RG.GetHeight=function(obj)
|
28
|
-
{return obj.canvas.height;};RG.getWidth=RG.GetWidth=function(obj)
|
29
|
-
{return obj.canvas.width;};RG.timer=RG.Timer=function(label)
|
30
|
-
{if(typeof RG.TIMER_LAST_CHECKPOINT=='undefined'){RG.TIMER_LAST_CHECKPOINT=Date.now();}
|
31
|
-
var now=Date.now();console.log(label+': '+(now-RG.TIMER_LAST_CHECKPOINT).toString());RG.TIMER_LAST_CHECKPOINT=now;};RG.setConfig=RG.SetConfig=function(obj,config)
|
32
|
-
{for(i in config){if(typeof i==='string'){obj.Set(i,config[i]);}}
|
33
|
-
return obj;};})(window,document);window.$empty=function(value)
|
34
|
-
{if(!value||value.length<=0){return true;}
|
35
|
-
return false;};
|
@@ -1,38 +0,0 @@
|
|
1
|
-
|
2
|
-
RGraph=window.RGraph||{isRGraph:true};(function(win,doc,undefined)
|
3
|
-
{var RG=RGraph,ua=navigator.userAgent,ma=Math,active=null;RGraph.allowResizing=RGraph.AllowResizing=function(obj)
|
4
|
-
{var ca=obj.canvas,co=obj.context,pa2=RG.path2;ca.resizing=ca.resizing||{};ca.resizing.placeHolders=ca.resizing.placeHolders||[];if(!ca.resizing.originalw){ca.resizing.originalw=ca.width;}
|
5
|
-
if(!ca.resizing.originalh){ca.resizing.originalh=ca.height;}
|
6
|
-
var resizeHandleSize=15;if(!ca.resizing.__rgraph_original_width__||!ca.resizing.__rgraph_original_height__||!ca.resizing.__adjustX||!ca.resizing.__adjustY){ca.resizing.__rgraph_original_width__=ca.width;ca.resizing.__rgraph_original_height__=ca.height;ca.resizing.adjustX=(typeof obj.get('chart.resizable.handle.adjust')=='object'&&typeof obj.get('chart.resizable.handle.adjust')[0]=='number'?obj.get('chart.resizable.handle.adjust')[0]:0);ca.resizing.adjustY=(typeof obj.get('chart.resizable.handle.adjust')=='object'&&typeof obj.get('chart.resizable.handle.adjust')[1]=='number'?obj.get('chart.resizable.handle.adjust')[1]:0);ca.resizing.bgcolor=obj.get('chart.resizable.handle.background')||'rgba(0,0,0,0)';}
|
7
|
-
pa2(co,'b m % % r % % % % f %',ca.width-resizeHandleSize-resizeHandleSize+ca.resizing.adjustX,ca.height-resizeHandleSize,ca.width-resizeHandleSize-resizeHandleSize+ca.resizing.adjustX,ca.height-resizeHandleSize+ca.resizing.adjustY,2*resizeHandleSize,resizeHandleSize,ca.resizing.bgcolor);pa2(co,'b lw 1 m % % l % % m % % l % % s gray f transparent',ma.round(ca.width-(resizeHandleSize/2)+ca.resizing.adjustX),ca.height-resizeHandleSize+ca.resizing.adjustY,ma.round(ca.width-(resizeHandleSize/2)+ca.resizing.adjustX),ca.height+ca.resizing.adjustY,ca.width+ca.resizing.adjustX,ma.round(ca.height-(resizeHandleSize/2)+ca.resizing.adjustY),ca.width-resizeHandleSize+ca.resizing.adjustX,ma.round(ca.height-(resizeHandleSize/2)+ca.resizing.adjustY));pa2(co,['b','m',ca.width-(resizeHandleSize/2)+ca.resizing.adjustX,ca.height-resizeHandleSize+ca.resizing.adjustY,'l',ca.width-(resizeHandleSize/2)+3+ca.resizing.adjustX,ca.height-resizeHandleSize+3+ca.resizing.adjustY,'l',ca.width-(resizeHandleSize/2)-3+ca.resizing.adjustX,ca.height-resizeHandleSize+3+ca.resizing.adjustY,'c','f','gray']);pa2(co,['b','m',ca.width-(resizeHandleSize/2)+ca.resizing.adjustX,ca.height+ca.resizing.adjustY,'l',ca.width-(resizeHandleSize/2)+3+ca.resizing.adjustX,ca.height-3+ca.resizing.adjustY,'l',ca.width-(resizeHandleSize/2)-3+ca.resizing.adjustX,ca.height-3+ca.resizing.adjustY,'c','f','gray']);pa2(co,['b','m',ca.width-resizeHandleSize+ca.resizing.adjustX,ca.height-(resizeHandleSize/2)+ca.resizing.adjustY,'l',ca.width-resizeHandleSize+3+ca.resizing.adjustX,ca.height-(resizeHandleSize/2)+3+ca.resizing.adjustY,'l',ca.width-resizeHandleSize+3+ca.resizing.adjustX,ca.height-(resizeHandleSize/2)-3+ca.resizing.adjustY,'c','f','gray']);pa2(co,['b','m',ca.width+ca.resizing.adjustX,ca.height-(resizeHandleSize/2)+ca.resizing.adjustY,'l',ca.width-3+ca.resizing.adjustX,ca.height-(resizeHandleSize/2)+3+ca.resizing.adjustY,'l',ca.width-3+ca.resizing.adjustX,ca.height-(resizeHandleSize/2)-3+ca.resizing.adjustY,'c','f','gray']);pa2(co,['b','m',ca.width+ca.resizing.adjustX,ca.height-(resizeHandleSize/2)+ca.resizing.adjustY,'r',ca.width-(resizeHandleSize/2)-2+ca.resizing.adjustX,ca.height-(resizeHandleSize/2)-2+ca.resizing.adjustY,4,4,'r',ca.width-(resizeHandleSize/2)-2+ca.resizing.adjustX,ca.height-(resizeHandleSize/2)-2+ca.resizing.adjustY,4,4,'s','gray','f','white']);pa2(co,['b','m',ma.round(ca.width-resizeHandleSize-3+ca.resizing.adjustX),ca.height-resizeHandleSize/2+ca.resizing.adjustY,'l',ma.round(ca.width-resizeHandleSize-resizeHandleSize+ca.resizing.adjustX),ca.height-(resizeHandleSize/2)+ca.resizing.adjustY,'l',ca.width-resizeHandleSize-resizeHandleSize+2+ca.resizing.adjustX,ca.height-(resizeHandleSize/2)-2+ca.resizing.adjustY,'l',ca.width-resizeHandleSize-resizeHandleSize+2+ca.resizing.adjustX,ca.height-(resizeHandleSize/2)+2+ca.resizing.adjustY,'l',ca.width-resizeHandleSize-resizeHandleSize+ca.resizing.adjustX,ca.height-(resizeHandleSize/2)+ca.resizing.adjustY,'s','gray','f','gray']);pa2(co,['b','m',ma.round(ca.width-resizeHandleSize-resizeHandleSize-1+ca.resizing.adjustX),ca.height-(resizeHandleSize/2)-3+ca.resizing.adjustY,'l',ma.round(ca.width-resizeHandleSize-resizeHandleSize-1+ca.resizing.adjustX),ca.height-(resizeHandleSize/2)+3+ca.resizing.adjustY,'s','f']);if(obj.get('chart.resizable')&&!ca.rgraphResizewrapper){ca.rgraphResizewrapper=$('<div id="rgraph_resize_container_'+ca.id+'"></div>').css({'float':ca.style.cssFloat,position:'relative'}).get(0);$(ca).wrap(ca.rgraphResizewrapper);ca.style.cssFloat='none';ca.style.top=0;ca.style.left=0;var window_onmousemove=function(e)
|
8
|
-
{var ca=active,obj=ca?ca.__object__:null;if(ca){e=RG.fixEventObject(e);if(ca.resizing.mousedown){var newWidth=ca.width+(e.pageX-ca.resizing.originalx),newHeight=ca.height+(e.pageY-ca.resizing.originaly),minWidth=obj.get('chart.resizable.minwidth'),minHeight=obj.get('chart.resizable.minheight');if(newWidth>(ca.resizing.originalw/2)&&(typeof obj.get('resizableMaxwidth')==='number'?newWidth<obj.get('resizableMaxwidth'):true)&&(typeof minWidth==='number'?newWidth>minWidth:true)){ca.resizing.div.style.width=newWidth+'px';}
|
9
|
-
if(newHeight>(ca.resizing.originalh/2)&&(typeof obj.get('chart.resizable.maxheight')==='number'?newHeight<obj.get('chart.resizable.maxheight'):true)&&(typeof minHeight==='number'?newHeight>minHeight:true)){ca.resizing.div.style.height=newHeight+'px';}
|
10
|
-
RG.fireCustomEvent(ca.__object__,'onresize');}}}
|
11
|
-
if(typeof ca.rgraph_resize_window_mousemove_listener_installed!='boolean'){window.addEventListener('mousemove',window_onmousemove,false);ca.rgraph_resize_window_mousemove_listener_installed=true;}
|
12
|
-
var MouseupFunc=function(e)
|
13
|
-
{if(!ca.resizing||!ca.resizing.div||!ca.resizing.mousedown){return;}
|
14
|
-
if(ca.resizing.div){var div=ca.resizing.div;var coords=RG.getCanvasXY(ca);var parentNode=ca.parentNode;if(ca.style.position!='absolute'){var placeHolderDIV=document.createElement('DIV');placeHolderDIV.style.width=ca.resizing.originalw+'px';placeHolderDIV.style.height=ca.resizing.originalh+'px';placeHolderDIV.style.display='inline-block';placeHolderDIV.style.position=ca.style.position;placeHolderDIV.style.left=ca.style.left;placeHolderDIV.style.top=ca.style.top;placeHolderDIV.style.cssFloat=ca.style.cssFloat;parentNode.insertBefore(placeHolderDIV,ca);}
|
15
|
-
ca.style.backgroundColor='white';ca.style.position='absolute';ca.style.border='1px dashed gray';ca.style.boxShadow='2px 2px 5px #ddd';ca.style.left=0;ca.style.top=0;ca.width=parseInt(div.style.width);ca.height=parseInt(div.style.height);ca.getContext('2d').translate(0.5,0.5);var objects=RG.ObjectRegistry.getObjectsByCanvasID(ca.id);for(var i=0,len=objects.length;i<len;i+=1){RG.resetColorsToOriginalValues(objects[i]);if(typeof objects[i].reset==='function'){objects[i].reset();}}
|
16
|
-
RG.cache=[];RG.fireCustomEvent(ca.__object__,'onresizebeforedraw');RG.redrawCanvas(ca);ca.resizing.mousedown=false;div.style.display='none';document.body.removeChild(div);}
|
17
|
-
if(RG.Registry.get('chart.zoomed.div')||RGraph.Registry.get('chart.zoomed.img')){RG.Registry.set('chart.zoomed.div',null);RG.Registry.set('chart.zoomed.img',null);}
|
18
|
-
RG.FireCustomEvent(ca.__object__,'onresizeend');};var window_onmouseup=MouseupFunc;if(typeof ca.rgraph_resize_window_mouseup_listener_installed!='boolean'){window.addEventListener('mouseup',window_onmouseup,false);ca.rgraph_resize_window_mouseup_listener_installed=true;}
|
19
|
-
var canvas_onmousemove=function(e)
|
20
|
-
{e=RG.fixEventObject(e);var coords=RG.getMouseXY(e);var obj=e.target.__object__;var ca=e.target;var co=ca.getContext('2d');var cursor=ca.style.cursor;if(!ca.resizing.original_cursor){ca.resizing.original_cursor=cursor;}
|
21
|
-
if((coords[0]>(ca.width-resizeHandleSize)&&coords[0]<ca.width&&coords[1]>(ca.height-resizeHandleSize)&&coords[1]<ca.height)){ca.style.cursor='move';}else if(coords[0]>(ca.width-resizeHandleSize-resizeHandleSize)&&coords[0]<ca.width-resizeHandleSize&&coords[1]>(ca.height-resizeHandleSize)&&coords[1]<ca.height){ca.style.cursor='pointer';}else{if(ca.resizing.original_cursor){ca.style.cursor=ca.resizing.original_cursor;ca.resizing.original_cursor=null;}else{ca.style.cursor='default';}}};if(typeof ca.rgraph_resize_mousemove_listener_installed!='boolean'){ca.addEventListener('mousemove',canvas_onmousemove,false);ca.rgraph_resize_mousemove_listener_installed=true;}
|
22
|
-
var canvas_onmouseout=function(e)
|
23
|
-
{e.target.style.cursor='default';e.target.title='';};if(typeof ca.rgraph_resize_mouseout_listener_installed!='boolean'){ca.addEventListener('mouseout',canvas_onmouseout,false);ca.rgraph_resize_mouseout_listener_installed=true;}
|
24
|
-
var canvas_onmousedown=function(e)
|
25
|
-
{e=RG.fixEventObject(e);var coords=RG.getMouseXY(e);var canvasXY=RG.getCanvasXY(e.target);var ca=e.target;active=ca;if(coords[0]>(ca.width-resizeHandleSize)&&coords[0]<ca.width&&coords[1]>(ca.height-resizeHandleSize)&&coords[1]<ca.height){RG.fireCustomEvent(obj,'onresizebegin');if(ca.resizing.original_css_border==null){ca.resizing.original_css_border=ca.style.border;}
|
26
|
-
if(ca.resizing.original_css_shadow==null){ca.resizing.original_css_shadow=ca.style.boxShadow;}
|
27
|
-
ca.resizing.mousedown=true;var div=document.createElement('DIV');div.style.position='absolute';div.style.left=canvasXY[0]+'px';div.style.top=canvasXY[1]+'px';div.style.width=ca.width+'px';div.style.height=ca.height+'px';div.style.border='1px dotted black';div.style.backgroundColor='gray';div.style.opacity=0.5;div.__canvas__=e.target;document.body.appendChild(div);ca.resizing.div=div;ca.resizing.placeHolders.push(div);for(var i=0;i<(ca.resizing.placeHolders.length-1);++i){ca.resizing.placeHolders[i].style.display='none';}
|
28
|
-
div.onmouseup=function(e)
|
29
|
-
{MouseupFunc(e);}
|
30
|
-
ca.resizing.div.onmouseover=function(e)
|
31
|
-
{e=RG.fixEventObject(e);e.stopPropagation();}
|
32
|
-
ca.resizing.originalx=e.pageX;ca.resizing.originaly=e.pageY;ca.resizing.originalCanvasX=RG.getCanvasXY(ca)[0];ca.resizing.originalCanvasY=RG.getCanvasXY(ca)[1];}
|
33
|
-
if(coords[0]>(ca.width-resizeHandleSize-resizeHandleSize)&&coords[0]<ca.width-resizeHandleSize&&coords[1]>(ca.height-resizeHandleSize)&&coords[1]<ca.height&&ca.resizing.originalw&&ca.resizing.originaly){RG.fireCustomEvent(ca.__object__,'onresizebegin');ca.width=ca.resizing.originalw;ca.height=ca.resizing.originalh;if(ca.__link__&&ca.__link__.style.display==='none'){ca.__link__.style.display='inline';}
|
34
|
-
if(typeof ca.parentNode.id==='string'&&ca.parentNode.id.substring(0,24)==='rgraph_resize_container_'){ca.parentNode.style.width=ca.resizing.originalw+'px';ca.parentNode.style.height=ca.resizing.originalh+'px';}
|
35
|
-
ca.style.border=ca.resizing.original_css_border;ca.style.boxShadow=ca.resizing.original_css_shadow;ca.style.left=(parseInt(ca.style.left))+'px';ca.style.top=(parseInt(ca.style.top))+'px';ca.getContext('2d').translate(0.5,0.5);RG.fireCustomEvent(ca.__object__,'onresizebeforedraw');var objects=RG.ObjectRegistry.getObjectsByCanvasID(ca.id);for(var i=0;i<objects.length;i+=1){RG.resetColorsToOriginalValues(objects[i]);if(objects[i].reset){objects[i].reset();}
|
36
|
-
RG.redrawCanvas(objects[i].canvas);}
|
37
|
-
RG.cache=[];if(ca.resizing.div){ca.resizing.div.style.width=ca.__original_width__+'px';ca.resizing.div.style.height=ca.__original_height__+'px';}
|
38
|
-
RG.fireCustomEvent(ca.__object__,'onresize');RG.fireCustomEvent(ca.__object__,'onresizeend');}};if(typeof ca.rgraph_resize_mousedown_listener_installed!='boolean'){ca.addEventListener('mousedown',canvas_onmousedown,false);ca.rgraph_resize_mousedown_listener_installed=true;}}};})(window,document);
|
@@ -1,15 +0,0 @@
|
|
1
|
-
|
2
|
-
RGraph=window.RGraph||{isRGraph:true};(function(win,doc,undefined)
|
3
|
-
{var RG=RGraph,ua=navigator.userAgent,ma=Math;RG.zoom=RG.Zoom=function(e)
|
4
|
-
{e=RGraph.fixEventObject(e);if(e&&e.target&&e.target.__canvas__){var canvas=e.target.__canvas__;}else if(e&&e.target&&e.target.__object__){var canvas=e.target.__object__.canvas;e.stopPropagation();}
|
5
|
-
if(!canvas){var registry_canvas=RGraph.Registry.get('chart.contextmenu').__canvas__;if(registry_canvas){var canvas=registry_canvas;}}
|
6
|
-
var obj=canvas.__object__;var context=obj.context;var dataurl=canvas.toDataURL();var tmp=canvas;var coords=RG.getCanvasXY(canvas);var factor=obj.Get('chart.zoom.factor')-1;var x=coords[0];var y=coords[1];var img=document.createElement('img');img.className='RGraph_zoomed_canvas';img.style.border='1px solid #ccc';img.style.width=canvas.width+'px';img.style.height=canvas.height+'px';img.style.position='absolute';img.style.left=x+'px';img.style.top=y+'px';img.style.backgroundColor='white';img.style.opacity=obj.Get('chart.zoom.fade.in')?0:1;img.style.zIndex=99;img.src=dataurl;document.body.appendChild(img);RGraph.zoom_image=img;RGraph.zoom_image.obj=obj;img.onclick=function(e)
|
7
|
-
{e=RGraph.fixEventObject(e);e.stopPropagation();return false;}
|
8
|
-
var width=parseInt(canvas.width);var height=parseInt(canvas.height);var frames=obj.Get('chart.zoom.frames');var delay=obj.Get('chart.zoom.delay');if(obj.Get('chart.zoom.hdir')=='center'){for(var i=1;i<=frames;++i){var newWidth=width*factor*(i/frames)+width;var rightHandEdge=x+canvas.width;var newLeft=(x+(canvas.width/2))-(newWidth/2);setTimeout("RGraph.zoom_image.style.width = '"+String(newWidth)+"px'; RGraph.zoom_image.style.left = '"+newLeft+"px'",i*delay);}}else if(obj.Get('chart.zoom.hdir')=='left'){for(var i=1;i<=frames;++i){var newWidth=width*factor*(i/frames)+width;var rightHandEdge=x+canvas.width;var newLeft=rightHandEdge-newWidth;setTimeout("RGraph.zoom_image.style.width = '"+String(newWidth)+"px'; RGraph.zoom_image.style.left = '"+newLeft+"px'",i*delay);}}else{for(var i=1;i<=frames;++i){var newWidth=width*factor*(i/frames)+width;setTimeout("RGraph.zoom_image.style.width = '"+String(newWidth)+"px'",i*delay);}}
|
9
|
-
if(obj.Get('chart.zoom.vdir')=='up'){for(var i=1;i<=frames;++i){var newHeight=(height*factor*(i/frames))+height;var bottomEdge=y+canvas.height;var newTop=bottomEdge-newHeight;setTimeout("RGraph.zoom_image.style.height = '"+String(newHeight)+"px'; RGraph.zoom_image.style.top = '"+newTop+"px'",i*delay);}}else if(obj.Get('chart.zoom.vdir')=='center'){for(var i=1;i<=frames;++i){var newHeight=(height*factor*(i/frames))+height;var bottomEdge=(y+(canvas.height/2))+(newHeight/2);var newTop=bottomEdge-newHeight;setTimeout("RGraph.zoom_image.style.height = '"+String(newHeight)+"px'; RGraph.zoom_image.style.top = '"+newTop+"px'",i*delay);}}else{for(var i=1;i<=frames;++i){setTimeout("RGraph.zoom_image.style.height = '"+String(height*factor*(i/frames)+height)+"px'",i*delay);}}
|
10
|
-
if(obj.Get('chart.zoom.fade.in')){for(var i=1;i<=frames;++i){setTimeout("RGraph.zoom_image.style.opacity = "+Number(i/frames),i*(delay/2));}}
|
11
|
-
if(obj.Get('chart.zoom.shadow')){for(var i=1;i<=frames;++i){setTimeout("RGraph.zoom_image.style.boxShadow = 'rgba(128,128,128,"+Number(i/frames)/2+") 0 0 25px'",i*delay);setTimeout("RGraph.zoom_image.style.MozBoxShadow = 'rgba(128,128,128,"+Number(i/frames)/2+") 0 0 25px'",i*delay);setTimeout("RGraph.zoom_image.style.WebkitBoxShadow = 'rgba(128,128,128,"+Number(i/frames)/2+") 0 0 25px'",i*delay);}}
|
12
|
-
var div=document.createElement('DIV');div.style.backgroundColor='white';div.style.opacity=0;div.style.position='fixed';div.style.top=0;div.style.left=0;div.style.width=(screen.width+100)+'px';div.style.height=(screen.height+100)+'px';div.style.zIndex=98;div.onclick=div.oncontextmenu=function(e)
|
13
|
-
{return RG.hideZoomedCanvas(e);}
|
14
|
-
div.origHeight=div.style.height;document.body.appendChild(div);RG.zoom_background=div;for(var i=1;i<=frames;++i){setTimeout("RGraph.zoom_background.style.opacity = "+(Number(i/frames)*0.8),i*(delay/2));}
|
15
|
-
RG.fireCustomEvent(obj,'onzoom');}})(window,document);
|
@@ -1,71 +0,0 @@
|
|
1
|
-
|
2
|
-
RGraph=window.RGraph||{isRGraph:true};RGraph.CornerGauge=function(conf)
|
3
|
-
{if(typeof conf==='object'&&typeof conf.min==='number'&&typeof conf.max==='number'&&typeof conf.value!=='undefined'&&typeof conf.id==='string'){var id=conf.id
|
4
|
-
var canvas=document.getElementById(id);var min=conf.min;var max=conf.max;var value=conf.value;var parseConfObjectForOptions=true;}else{var id=conf;var canvas=document.getElementById(id);var min=arguments[1];var max=arguments[2];var value=arguments[3];}
|
5
|
-
this.id=id;this.canvas=canvas;this.context=this.canvas.getContext?this.canvas.getContext("2d",{alpha:(typeof id==='object'&&id.alpha===false)?false:true}):null;this.canvas.__object__=this;this.type='cornergauge';this.min=min;this.max=max;this.value=RGraph.stringsToNumbers(value);this.angles={};this.angles.needle=[];this.centerpin={};this.isRGraph=true;this.currentValue=null;this.uid=RGraph.CreateUID();this.canvas.uid=this.canvas.uid?this.canvas.uid:RGraph.CreateUID();this.coordsText=[];this.original_colors=[];this.firstDraw=true;if(typeof(this.value)=='object'){for(var i=0;i<this.value.length;++i){if(this.value[i]>this.max)this.value[i]=max;if(this.value[i]<this.min)this.value[i]=min;}}else{if(this.value>this.max)this.value=max;if(this.value<this.min)this.value=min;}
|
6
|
-
this.properties={'chart.centerx':null,'chart.centery':null,'chart.radius':null,'chart.gutter.left':25,'chart.gutter.right':25,'chart.gutter.top':25,'chart.gutter.bottom':25,'chart.strokestyle':'black','chart.linewidth':2,'chart.title':'','chart.title.vpos':0.5,'chart.title.size':null,'chart.title.x':null,'chart.title.y':null,'chart.title.bold':true,'chart.text.font':'Arial','chart.text.color':'#666','chart.text.size':10,'chart.background.gradient.color1':'#ddd','chart.background.gradient.color2':'white','chart.shadow':true,'chart.shadow.color':'gray','chart.shadow.offsetx':0,'chart.shadow.offsety':0,'chart.shadow.blur':15,'chart.scale.decimals':0,'chart.scale.point':'.','chart.scale.thousand':',','chart.units.pre':'','chart.units.post':'','chart.resizable':false,'chart.chart.resize.handle.background':null,'chart.adjustable':false,'chart.annotatable':false,'chart.annotate.color':'black','chart.colors.ranges':null,'chart.red.start':min+(0.9*(this.max-min)),'chart.green.end':min+(0.7*(this.max-min)),'chart.red.color':'red','chart.yellow.color':'yellow','chart.green.color':'#0f0','chart.value.text':true,'chart.value.text.units.pre':'','chart.value.text.units.post':'','chart.value.text.boxed':true,'chart.value.text.font':'Arial','chart.value.text.size':18,'chart.value.text.bold':false,'chart.value.text.decimals':0,'chart.centerpin.stroke':'rgba(0,0,0,0)','chart.centerpin.fill':null,'chart.centerpin.color':'blue','chart.needle.colors':['#ccc','#D5604D','red','green','yellow'],'chart.zoom.factor':1.5,'chart.zoom.fade.in':true,'chart.zoom.fade.out':true,'chart.zoom.hdir':'right','chart.zoom.vdir':'down','chart.zoom.frames':25,'chart.zoom.delay':16.666,'chart.zoom.shadow':true,'chart.zoom.background':true}
|
7
|
-
if(!this.canvas.__rgraph_aa_translated__){this.context.translate(0.5,0.5);this.canvas.__rgraph_aa_translated__=true;}
|
8
|
-
var RG=RGraph;var ca=this.canvas;var co=ca.getContext('2d');var prop=this.properties;var jq=jQuery;var pa=RG.Path;var win=window;var doc=document;var ma=Math;this.set=this.Set=function(name,value)
|
9
|
-
{if(arguments.length===1&&typeof arguments[0]==='object'){RG.parseObjectStyleConfig(this,arguments[0]);return this;}
|
10
|
-
name=name.toLowerCase();if(name.substr(0,6)!='chart.'){name='chart.'+name;}
|
11
|
-
prop[name]=value;return this;};this.get=this.Get=function(name)
|
12
|
-
{if(name.substr(0,6)!='chart.'){name='chart.'+name;}
|
13
|
-
return prop[name];};this.draw=this.Draw=function()
|
14
|
-
{RG.FireCustomEvent(this,'onbeforedraw');this.currentValue=this.value;if(typeof this.gutterLeft=='undefined'){this.gutterLeft=prop['chart.gutter.left'];this.gutterRight=prop['chart.gutter.right'];this.gutterTop=prop['chart.gutter.top'];this.gutterBottom=prop['chart.gutter.bottom'];}
|
15
|
-
this.radius=Math.min((ca.width-this.gutterLeft-this.gutterRight),(ca.height-this.gutterTop-this.gutterBottom));if(typeof(prop['chart.radius'])=='number')this.radius=prop['chart.radius'];this.centerx=(ca.width/2)-(this.radius/2)+Math.max(30,this.radius*0.1);this.centery=(ca.height/2)+(this.radius/2)-(this.radius*0.1);this.coordsText=[];if(typeof prop['chart.centerx']==='number')this.centerx=prop['chart.centerx'];if(typeof prop['chart.centery']==='number')this.centery=prop['chart.centery'];if(!this.colorsParsed){this.parseColors();this.colorsParsed=true;}
|
16
|
-
this.DrawBackGround();this.DrawTickmarks();this.DrawColorBands();this.DrawLabel();this.DrawLabels();if(typeof this.value==='object'){for(var i=0,len=this.value.length;i<len;++i){this.DrawNeedle(i,this.value[i],this.radius-65);}}else{this.DrawNeedle(0,this.value,this.radius-65);}
|
17
|
-
this.DrawCenterpin();var size=prop['chart.title.size']?prop['chart.title.size']:prop['chart.text.size']+2
|
18
|
-
prop['chart.title.y']=this.centery+20-this.radius-((1.5*size)/2);RGraph.DrawTitle(this,prop['chart.title'],this.guttertop,this.centerx+(this.radius/2),size);if(prop['chart.contextmenu']){RGraph.ShowContext(this);}
|
19
|
-
if(prop['chart.resizable']){RGraph.AllowResizing(this);}
|
20
|
-
RGraph.InstallEventListeners(this);if(this.firstDraw){RG.fireCustomEvent(this,'onfirstdraw');this.firstDraw=false;this.firstDrawFunc();}
|
21
|
-
RGraph.FireCustomEvent(this,'ondraw');return this;};this.drawBackGround=this.DrawBackGround=function()
|
22
|
-
{if(prop['chart.shadow']){RGraph.SetShadow(this,prop['chart.shadow.color'],prop['chart.shadow.offsetx'],prop['chart.shadow.offsety'],prop['chart.shadow.blur']);}
|
23
|
-
co.strokeStyle=prop['chart.strokestyle'];co.lineWidth=prop['chart.linewidth']?prop['chart.linewidth']:0.0001;co.beginPath();co.arc(this.centerx,this.centery,30,0,RGraph.TWOPI,false);co.stroke();co.beginPath();co.moveTo(this.centerx-20,this.centery+20);co.arc(this.centerx-20,this.centery+20,this.radius,RGraph.PI+RGraph.HALFPI,RGraph.TWOPI,false);co.closePath();co.fill();co.stroke();RG.NoShadow(this);co.strokeStyle=prop['chart.strokestyle'];co.lineWidth=prop['chart.linewidth']?prop['chart.linewidth']:0.0001;co.beginPath();co.moveTo(this.centerx-20,this.centery+20);co.arc(this.centerx-20,this.centery+20,this.radius,RGraph.PI+RGraph.HALFPI,RGraph.TWOPI,false);co.closePath();co.stroke();RGraph.NoShadow(this);co.lineWidth=0;co.fillStyle=RGraph.RadialGradient(this,this.centerx,this.centery,0,this.centerx,this.centery,this.radius*0.5,prop['chart.background.gradient.color1'],prop['chart.background.gradient.color2']);co.beginPath();co.moveTo(this.centerx,this.centery);co.arc(this.centerx,this.centery,30,0,RGraph.TWOPI,0);co.closePath();co.fill();co.beginPath();co.moveTo(this.centerx-20,this.centery+20);co.lineTo(this.centerx-20,this.centery+20-this.radius);co.arc(this.centerx-20,this.centery+20,this.radius,RGraph.PI+RGraph.HALFPI,RGraph.TWOPI,false);co.closePath();co.fill();co.beginPath();co.lineWidth=1;co.strokeStyle='#eee';for(var i=0;i<=5;++i){var p1=RG.getRadiusEndPoint(this.centerx,this.centery,(RGraph.HALFPI/5*i)+RGraph.PI+RGraph.HALFPI,30);var p2=RG.getRadiusEndPoint(this.centerx,this.centery,(RGraph.HALFPI/5*i)+RGraph.PI+RGraph.HALFPI,this.radius-90);co.moveTo(p1[0],p1[1]);co.lineTo(p2[0],p2[1]);}
|
24
|
-
co.stroke();};this.drawNeedle=this.DrawNeedle=function(index,value,radius)
|
25
|
-
{var grad=RG.RadialGradient(this,this.centerx,this.centery,0,this.centerx,this.centery,20,'rgba(0,0,0,0)',prop['chart.needle.colors'][index])
|
26
|
-
this.angles.needle[index]=(((value-this.min)/(this.max-this.min))*RG.HALFPI)+RG.PI+RG.HALFPI;co.lineWidth=1
|
27
|
-
co.strokeStyle='rgba(0,0,0,0)';co.fillStyle=grad;co.beginPath();co.moveTo(this.centerx,this.centery);co.arc(this.centerx,this.centery,10,this.angles.needle[index]-RG.HALFPI,this.angles.needle[index]-RG.HALFPI+0.000001,false);co.arc(this.centerx,this.centery,radius-30,this.angles.needle[index],this.angles.needle[index]+0.000001,false);co.arc(this.centerx,this.centery,10,this.angles.needle[index]+RG.HALFPI,this.angles.needle[index]+RG.HALFPI+0.000001,false);co.stroke();co.fill();};this.drawCenterpin=this.DrawCenterpin=function()
|
28
|
-
{if(!prop['chart.centerpin.fill']){prop['chart.centerpin.fill']=RG.RadialGradient(this,this.centerx+5,this.centery-5,0,this.centerx+5,this.centery-5,20,'white',prop['chart.centerpin.color'])}
|
29
|
-
co.strokeStyle=prop['chart.centerpin.stroke'];co.fillStyle=prop['chart.centerpin.fill'];co.beginPath();co.lineWidth=2;co.arc(this.centerx,this.centery,15,0,RGraph.TWOPI,false);co.stroke();co.fill();};this.drawLabels=this.DrawLabels=function()
|
30
|
-
{var numLabels=6;co.fillStyle=prop['chart.text.color'];for(var i=0;i<numLabels;++i){co.beginPath();var num=Number(this.min+((this.max-this.min)*(i/(numLabels-1)))).toFixed(prop['chart.scale.decimals']);num=RG.number_format(this,num,prop['chart.units.pre'],prop['chart.units.post']);var angle=(i*18)/(180/RG.PI);RG.Text2(this,{'font':prop['chart.text.font'],'size':prop['chart.text.size'],'x':this.centerx+ma.sin(angle)*(this.radius-53),'y':this.centery-ma.cos(angle)*(this.radius-53),'text':String(num),'valign':'top','halign':'center','angle':90*(i/(numLabels-1)),'tag':'scale'});co.fill();}};this.drawTickmarks=this.DrawTickmarks=function()
|
31
|
-
{var bigTicks=5;var smallTicks=25;for(var i=0;i<smallTicks;++i){co.beginPath();var angle=(RG.HALFPI/(smallTicks-1))*i
|
32
|
-
co.lineWidth=1;co.arc(this.centerx,this.centery,this.radius-44,RG.PI+RG.HALFPI+angle,RG.PI+RG.HALFPI+angle+0.0001,false);co.arc(this.centerx,this.centery,this.radius-46,RG.PI+RG.HALFPI+angle,RG.PI+RG.HALFPI+angle+0.0001,false);co.stroke();}
|
33
|
-
for(var i=0;i<bigTicks;++i){co.beginPath();var angle=(RG.HALFPI/(bigTicks-1))*i
|
34
|
-
co.lineWidth=1;co.arc(this.centerx,this.centery,this.radius-43,RG.PI+RG.HALFPI+angle,RG.PI+RG.HALFPI+angle+0.0001,false);co.arc(this.centerx,this.centery,this.radius-47,RG.PI+RG.HALFPI+angle,RG.PI+RG.HALFPI+angle+0.0001,false);co.stroke();}};this.DrawColorBands=function()
|
35
|
-
{if(RG.is_array(prop['chart.colors.ranges'])){var ranges=prop['chart.colors.ranges'];for(var i=0,len=ranges.length;i<len;++i){co.fillStyle=ranges[i][2];co.lineWidth=0;co.beginPath();co.arc(this.centerx,this.centery,this.radius-54-(prop['chart.text.size']*1.5),(((ranges[i][0]-this.min)/(this.max-this.min))*RG.HALFPI)+(RG.PI+RG.HALFPI),(((ranges[i][1]-this.min)/(this.max-this.min))*RG.HALFPI)+(RG.PI+RG.HALFPI),false);co.arc(this.centerx,this.centery,this.radius-54-10-(prop['chart.text.size']*1.5),(((ranges[i][1]-this.min)/(this.max-this.min))*RG.HALFPI)+(RG.PI+RG.HALFPI),(((ranges[i][0]-this.min)/(this.max-this.min))*RG.HALFPI)+(RG.PI+RG.HALFPI),true);co.closePath();co.fill();}
|
36
|
-
return;}
|
37
|
-
co.strokeStyle=prop['chart.green.color'];co.fillStyle=prop['chart.green.color'];var greenStart=RG.PI+RG.HALFPI;var greenEnd=greenStart+(RG.TWOPI-greenStart)*((prop['chart.green.end']-this.min)/(this.max-this.min))
|
38
|
-
co.beginPath();co.arc(this.centerx,this.centery,this.radius-54-(prop['chart.text.size']*1.5),greenStart,greenEnd,false);co.arc(this.centerx,this.centery,this.radius-54-(prop['chart.text.size']*1.5)-10,greenEnd,greenStart,true);co.fill();co.strokeStyle=prop['chart.yellow.color'];co.fillStyle=prop['chart.yellow.color'];var yellowStart=greenEnd;var yellowEnd=(((prop['chart.red.start']-this.min)/(this.max-this.min))*RG.HALFPI)+RG.PI+RG.HALFPI;co.beginPath();co.arc(this.centerx,this.centery,this.radius-54-(prop['chart.text.size']*1.5),yellowStart,yellowEnd,false);co.arc(this.centerx,this.centery,this.radius-54-(prop['chart.text.size']*1.5)-10,yellowEnd,yellowStart,true);co.fill();co.strokeStyle=prop['chart.red.color'];co.fillStyle=prop['chart.red.color'];var redStart=yellowEnd;var redEnd=RGraph.TWOPI;co.beginPath();co.arc(this.centerx,this.centery,this.radius-54-(prop['chart.text.size']*1.5),redStart,redEnd,false);co.arc(this.centerx,this.centery,this.radius-54-(prop['chart.text.size']*1.5)-10,redEnd,redStart,true);co.fill();};this.drawLabel=this.DrawLabel=function()
|
39
|
-
{if(prop['chart.value.text']){co.strokeStyle=prop['chart.text.color'];co.fillStyle=prop['chart.text.color'];var value=typeof(this.value)=='number'?this.value.toFixed(prop['chart.value.text.decimals']):this.value;if(typeof(value)=='object'){for(var i=0;i<value.length;++i){value[i]=parseFloat(value[i]).toFixed(prop['chart.value.text.decimals']);}
|
40
|
-
value=value.toString();}
|
41
|
-
RG.Text2(this,{'font':prop['chart.value.text.font'],'size':prop['chart.value.text.size'],'x':this.centerx+(ma.cos((RG.PI/180)*45)*(this.radius/3)),'y':this.centery-(ma.sin((RG.PI/180)*45)*(this.radius/3)),'text':prop['chart.value.text.units.pre']+value+prop['chart.value.text.units.post'],'valign':'center','halign':'center','bounding':prop['chart.value.text.boxed'],'boundingFill':'white','bold':prop['chart.value.text.bold'],'tag':'value.text'});}};this.getShape=function(e){};this.getValue=function(e)
|
42
|
-
{var mouseXY=RGraph.getMouseXY(e);var mouseX=mouseXY[0];var mouseY=mouseXY[1];var angle=RG.getAngleByXY(this.centerx,this.centery,mouseX,mouseY);if(angle>RG.TWOPI&&angle<(RG.PI+RG.HALFPI)){return null;}
|
43
|
-
var value=((angle-(RG.PI+RG.HALFPI))/(RG.TWOPI-(RG.PI+RG.HALFPI)))*(this.max-this.min);value=value+this.min;if(value<this.min){value=this.min}
|
44
|
-
if(value>this.max){value=this.max}
|
45
|
-
if(mouseX>this.centerx&&mouseY>this.centery){value=this.max;}
|
46
|
-
return value;};this.getObjectByXY=function(e)
|
47
|
-
{var mouseXY=RGraph.getMouseXY(e);if(mouseXY[0]>(this.centerx-5)&&mouseXY[0]<(this.centerx+this.radius)&&mouseXY[1]>(this.centery-this.radius)&&mouseXY[1]<(this.centery+5)&&RG.getHypLength(this.centerx,this.centery,mouseXY[0],mouseXY[1])<=this.radius){return this;}};this.adjusting_mousemove=this.Adjusting_mousemove=function(e)
|
48
|
-
{if(prop['chart.adjustable']&&RG.Registry.Get('chart.adjusting')&&RG.Registry.Get('chart.adjusting').uid==this.uid){this.value=this.getValue(e);RG.Clear(ca);RG.RedrawCanvas(ca);RG.FireCustomEvent(this,'onadjust');}};this.getAngle=function(value)
|
49
|
-
{if(value<this.min||value>this.max){return null;}
|
50
|
-
var angle=((value-this.min)/(this.max-this.min))*RG.HALFPI
|
51
|
-
angle+=(RG.PI+RG.HALFPI);return angle;};this.parseColors=function()
|
52
|
-
{if(this.original_colors.length===0){this.original_colors['chart.colors.ranges']=RG.array_clone(prop['chart.colors.ranges']);this.original_colors['chart.green.color']=RG.array_clone(prop['chart.green.color']);this.original_colors['chart.yellow.color']=RG.array_clone(prop['chart.yellow.color']);this.original_colors['chart.red.color']=RG.array_clone(prop['chart.red.color']);}
|
53
|
-
if(!RG.is_null(prop['chart.colors.ranges'])){for(var i=0;i<prop['chart.colors.ranges'].length;++i){prop['chart.colors.ranges'][i][2]=this.parseSingleColorForGradient(prop['chart.colors.ranges'][i][2]);}}else{prop['chart.green.color']=this.parseSingleColorForGradient(prop['chart.green.color']);prop['chart.yellow.color']=this.parseSingleColorForGradient(prop['chart.yellow.color']);prop['chart.red.color']=this.parseSingleColorForGradient(prop['chart.red.color']);}};this.reset=function()
|
54
|
-
{};this.parseSingleColorForGradient=function(color)
|
55
|
-
{if(!color||typeof(color)!='string'){return color;}
|
56
|
-
if(color.match(/^gradient\((.*)\)$/i)){var parts=RegExp.$1.split(':');var radius_start=this.radius-54-prop['chart.text.size'];var radius_end=radius_start-15;var grad=co.createRadialGradient(this.centerx,this.centery,radius_start,this.centerx,this.centery,radius_end);var diff=1/(parts.length-1);grad.addColorStop(0,RG.trim(parts[0]));for(var j=1,len=parts.length;j<len;++j){grad.addColorStop(j*diff,RG.trim(parts[j]));}}
|
57
|
-
return grad?grad:color;};this.on=function(type,func)
|
58
|
-
{if(type.substr(0,2)!=='on'){type='on'+type;}
|
59
|
-
this[type]=func;return this;};this.firstDrawFunc=function()
|
60
|
-
{};this.grow=function()
|
61
|
-
{var opt=arguments[0];var callback=arguments[1];var numFrames=30;var frame=0;var obj=this;if(typeof this.value==='number'){var origValue=Number(this.currentValue);if(this.currentValue===null){this.currentValue=this.min;origValue=this.min;}
|
62
|
-
var newValue=this.value;var diff=newValue-origValue;var step=(diff/numFrames);var frame=0;var iterator=function()
|
63
|
-
{frame++;obj.value=((frame/numFrames)*diff)+origValue
|
64
|
-
if(obj.value>obj.max)obj.value=obj.max;if(obj.value<obj.min)obj.value=obj.min;RGraph.Clear(obj.canvas);RGraph.RedrawCanvas(obj.canvas);if(frame<30){RGraph.Effects.updateCanvas(iterator);}else if(typeof callback==='function'){callback(obj);}};iterator();}else{if(obj.currentValue==null){obj.currentValue=[];for(var i=0,len=obj.value.length;i<len;++i){obj.currentValue[i]=obj.min;}
|
65
|
-
origValue=RG.array_clone(obj.currentValue);}
|
66
|
-
var origValue=RG.array_clone(obj.currentValue);var newValue=RG.array_clone(obj.value);var diff=[];var step=[];for(var i=0,len=newValue.length;i<len;++i){diff[i]=newValue[i]-Number(obj.currentValue[i]);step[i]=(diff[i]/numFrames);}
|
67
|
-
var max=this.max;var min=this.min;var iterator=function()
|
68
|
-
{frame++;for(var i=0,len=obj.value.length;i<len;++i){obj.value[i]=((frame/numFrames)*diff[i])+origValue[i];if(obj.value[i]>max)obj.value[i]=max;if(obj.value[i]<min)obj.value[i]=min;RG.clear(obj.canvas);RG.redrawCanvas(obj.canvas);}
|
69
|
-
if(frame<30){RG.Effects.updateCanvas(iterator);}else if(typeof callback==='function'){callback(obj);}};iterator();}
|
70
|
-
return this;}
|
71
|
-
RG.Register(this);if(parseConfObjectForOptions){RG.parseObjectStyleConfig(this,conf.options);}};
|