amcharts.rb 3.1.1.0.pre → 3.1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/.gitignore +1 -0
- data/README.md +70 -6
- data/Rakefile +4 -0
- data/amcharts.rb.gemspec +10 -8
- data/app/assets/images/amcharts/loading.gif +0 -0
- data/app/assets/javascripts/amcharts.js +119 -0
- data/app/assets/stylesheets/amcharts.css +39 -0
- data/app/helpers/amcharts/amcharts_helper.rb +24 -0
- data/app/views/amcharts/_collection.erb +5 -0
- data/app/views/amcharts/_data.erb +10 -0
- data/app/views/amcharts/_legend.erb +4 -0
- data/app/views/amcharts/_listener.erb +1 -0
- data/app/views/amcharts/_object.erb +12 -0
- data/app/views/amcharts/_settings.erb +1 -0
- data/app/views/amcharts/_title.erb +1 -0
- data/app/views/amcharts/chart_builder.erb +36 -0
- data/lib/amcharts.rb +23 -3
- data/lib/amcharts/axis.rb +8 -0
- data/lib/amcharts/axis/category.rb +5 -0
- data/lib/amcharts/axis/value.rb +5 -0
- data/lib/amcharts/chart.rb +108 -0
- data/lib/amcharts/chart/funnel.rb +7 -0
- data/lib/amcharts/chart/gauge.rb +7 -0
- data/lib/amcharts/chart/pie.rb +15 -0
- data/lib/amcharts/chart/radar.rb +7 -0
- data/lib/amcharts/chart/rectangular.rb +22 -0
- data/lib/amcharts/chart/serial.rb +10 -0
- data/lib/amcharts/chart/xy.rb +7 -0
- data/lib/amcharts/chart_builder.rb +79 -0
- data/lib/amcharts/chart_builder/function.rb +7 -0
- data/lib/amcharts/cursor.rb +5 -0
- data/lib/amcharts/graph.rb +14 -0
- data/lib/amcharts/legend.rb +5 -0
- data/lib/amcharts/listener.rb +10 -0
- data/lib/amcharts/scroll_bar.rb +5 -0
- data/lib/amcharts/settings.rb +32 -0
- data/lib/amcharts/uses_settings.rb +10 -0
- data/lib/amcharts/version.rb +1 -1
- data/spec/chart/serial_spec.rb +5 -0
- data/spec/chart_spec.rb +17 -0
- data/vendor/assets/images/amcharts/eraserIcon.gif +0 -0
- data/vendor/assets/images/amcharts/eraserIconH.gif +0 -0
- data/vendor/assets/images/amcharts/pencilIcon.gif +0 -0
- data/vendor/assets/images/amcharts/pencilIconH.gif +0 -0
- data/vendor/assets/images/amcharts/xIcon.gif +0 -0
- data/vendor/assets/images/amcharts/xIconH.gif +0 -0
- data/vendor/assets/javascripts/amcharts/all.js +10 -0
- data/vendor/assets/javascripts/amcharts/amstock.js +86 -0
- data/vendor/assets/javascripts/amcharts/changeLog.txt +887 -0
- data/vendor/assets/javascripts/amcharts/licence.txt +16 -0
- data/vendor/assets/javascripts/amcharts/pie.js +1 -1
- data/vendor/assets/javascripts/amcharts/thirdPartySoftwareList.txt +11 -0
- data/vendor/assets/stylesheets/amcharts/style.css +58 -0
- metadata +81 -5
@@ -0,0 +1,16 @@
|
|
1
|
+
*********************************************************************************
|
2
|
+
This AmCharts software is free under a linkware license.
|
3
|
+
|
4
|
+
This means you may not remove or hide in any other way link to amcharts
|
5
|
+
web site - www.amcharts.com.
|
6
|
+
|
7
|
+
If you wish to remove the link, you should purchase commercial license.
|
8
|
+
|
9
|
+
You may not redistribute, sublicense or sell this program without written
|
10
|
+
permission of Antanas Marcelionis, the author of amcharts software.
|
11
|
+
|
12
|
+
This software is provided without warranty.
|
13
|
+
*********************************************************************************
|
14
|
+
A commercial version (without link) is available at amCharts's website:
|
15
|
+
http://shop.amcharts.com/
|
16
|
+
*********************************************************************************
|
@@ -6,4 +6,4 @@ this.chartCreated&&(t=b.alpha);p.setAttr("opacity",t)}b.ix=r;b.iy=y;b.wedge=p;b.
|
|
6
6
|
m=AmCharts.text(c,m,B,this.fontFamily,this.fontSize,z);m.translate(t+1.5*v,u);b.tx=t+1.5*v;b.ty=u;u=d+(f-d)/2;b.pulled&&(u+=this.pullOutRadiusReal);b.balloonX=r*u+w;b.balloonY=y*u+x;0<=n?p.push(m):this.freeLabelsSet.push(m);b.label=m;b.tx=t;b.tx2=t+v;b.tx0=w+r*f;b.ty0=x+y*f}b.startX=Math.round(r*q);b.startY=Math.round(y*q);b.pullX=Math.round(r*h);b.pullY=Math.round(y*h);this.graphsSet.push(p);(0===b.alpha||0<g&&!this.chartCreated)&&p.hide();l+=360*b.percents/100}0<s&&!this.labelRadiusField&&this.arrangeLabels();
|
7
7
|
this.pieXReal=w;this.pieYReal=x;this.radiusReal=f;this.innerRadiusReal=d;0<s&&this.drawTicks();this.initialStart();this.setDepths()}(e=this.legend)&&e.invalidateSize()}else this.cleanChart();this.dispDUpd();this.chartCreated=!0},setDepths:function(){var e=this.chartData,g;for(g=0;g<e.length;g++){var c=e[g],a=c.wedge,c=c.startAngle;0<=c&&180>c?a.toFront():180<=c&&a.toBack()}},arrangeLabels:function(){var e=this.chartData,g=e.length,c,a;for(a=g-1;0<=a;a--)c=e[a],0!==c.labelQuarter||c.hidden||this.checkOverlapping(a,
|
8
8
|
c,0,!0,0);for(a=0;a<g;a++)c=e[a],1!=c.labelQuarter||c.hidden||this.checkOverlapping(a,c,1,!1,0);for(a=g-1;0<=a;a--)c=e[a],2!=c.labelQuarter||c.hidden||this.checkOverlapping(a,c,2,!0,0);for(a=0;a<g;a++)c=e[a],3!=c.labelQuarter||c.hidden||this.checkOverlapping(a,c,3,!1,0)},checkOverlapping:function(e,g,c,a,h){var d,k,b=this.chartData,q=b.length,l=g.label;if(l){if(!0===a)for(k=e+1;k<q;k++)b[k].labelQuarter==c&&(d=this.checkOverlappingReal(g,b[k],c))&&(k=q);else for(k=e-1;0<=k;k--)b[k].labelQuarter==
|
9
|
-
c&&(d=this.checkOverlappingReal(g,b[k],c))&&(k=0);!0===d&&100>h&&(d=g.ty+3*g.iy,g.ty=d,l.translate(g.tx2,d),this.checkOverlapping(e,g,c,a,h+1))}},checkOverlappingReal:function(e,g,c){var a=!1,h=e.label,d=g.label;e.labelQuarter!=c||e.hidden||g.hidden||!d||(h=h.getBBox(),c={},c.width=h.width,c.height=h.height,c.y=e.ty,c.x=e.tx,e=d.getBBox(),d={},d.width=e.width,d.height=e.height,d.y=g.ty,d.x=g.tx,AmCharts.hitTest(c,d)&&(a=!0));return a}});
|
9
|
+
c&&(d=this.checkOverlappingReal(g,b[k],c))&&(k=0);!0===d&&100>h&&(d=g.ty+3*g.iy,g.ty=d,l.translate(g.tx2,d),this.checkOverlapping(e,g,c,a,h+1))}},checkOverlappingReal:function(e,g,c){var a=!1,h=e.label,d=g.label;e.labelQuarter!=c||e.hidden||g.hidden||!d||(h=h.getBBox(),c={},c.width=h.width,c.height=h.height,c.y=e.ty,c.x=e.tx,e=d.getBBox(),d={},d.width=e.width,d.height=e.height,d.y=g.ty,d.x=g.tx,AmCharts.hitTest(c,d)&&(a=!0));return a}});
|
@@ -0,0 +1,11 @@
|
|
1
|
+
*********************************************************************************
|
2
|
+
Third party software used:
|
3
|
+
|
4
|
+
Jason S. Kerchner base class (http://livingmachines.net)
|
5
|
+
Licensed under BSD license: http://livingmachines.net/license/
|
6
|
+
|
7
|
+
David Knape & Patrick Mineault Bezier curves drawing logic.
|
8
|
+
|
9
|
+
Code optimization made using Closure Compiling service:
|
10
|
+
http://closure-compiler.appspot.com/home
|
11
|
+
*********************************************************************************
|
@@ -0,0 +1,58 @@
|
|
1
|
+
.amChartsDataSetSelector
|
2
|
+
{
|
3
|
+
font-size:12px;
|
4
|
+
font-family:verdana,helvetica,arial,sans-serif;
|
5
|
+
}
|
6
|
+
|
7
|
+
.amChartsPeriodSelector
|
8
|
+
{
|
9
|
+
font-size:12px;
|
10
|
+
font-family:verdana,helvetica,arial,sans-serif;
|
11
|
+
}
|
12
|
+
|
13
|
+
.amChartsButtonSelected
|
14
|
+
{
|
15
|
+
background-color:#CC0000;
|
16
|
+
border-style:solid;
|
17
|
+
border-color:#CC0000;
|
18
|
+
border-width:1px;
|
19
|
+
color:#FFFFFF;
|
20
|
+
-moz-border-radius: 5px;
|
21
|
+
border-radius: 5px;
|
22
|
+
margin: 1px;
|
23
|
+
}
|
24
|
+
|
25
|
+
.amChartsButton
|
26
|
+
{
|
27
|
+
background-color:#EEEEEE;
|
28
|
+
border-style:solid;
|
29
|
+
border-color:#CCCCCC;
|
30
|
+
border-width:1px;
|
31
|
+
color:#000000;
|
32
|
+
-moz-border-radius: 5px;
|
33
|
+
border-radius: 5px;
|
34
|
+
margin: 1px;
|
35
|
+
}
|
36
|
+
|
37
|
+
.amChartsCompareList
|
38
|
+
{
|
39
|
+
border-style:solid;
|
40
|
+
border-color:#CCCCCC;
|
41
|
+
border-width:1px;
|
42
|
+
}
|
43
|
+
|
44
|
+
|
45
|
+
.amChartsInputField
|
46
|
+
{
|
47
|
+
|
48
|
+
}
|
49
|
+
|
50
|
+
.amChartsLegend
|
51
|
+
{
|
52
|
+
|
53
|
+
}
|
54
|
+
|
55
|
+
.amChartsPanel
|
56
|
+
{
|
57
|
+
|
58
|
+
}
|
metadata
CHANGED
@@ -1,15 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: amcharts.rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.1.0
|
4
|
+
version: 3.1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Vandersluis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
type: :runtime
|
15
|
+
prerelease: false
|
16
|
+
name: rails
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
|
+
requirements:
|
19
|
+
- - ! '>'
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 3.0.0
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ! '>'
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 3.0.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
type: :runtime
|
29
|
+
prerelease: false
|
30
|
+
name: collection_of
|
31
|
+
requirement: !ruby/object:Gem::Requirement
|
32
|
+
requirements:
|
33
|
+
- - ! '>='
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: 1.0.3
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ! '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 1.0.3
|
13
41
|
- !ruby/object:Gem::Dependency
|
14
42
|
type: :development
|
15
43
|
prerelease: false
|
@@ -51,10 +79,46 @@ files:
|
|
51
79
|
- README.md
|
52
80
|
- Rakefile
|
53
81
|
- amcharts.rb.gemspec
|
82
|
+
- app/assets/images/amcharts/loading.gif
|
83
|
+
- app/assets/javascripts/amcharts.js
|
84
|
+
- app/assets/stylesheets/amcharts.css
|
85
|
+
- app/helpers/amcharts/amcharts_helper.rb
|
86
|
+
- app/views/amcharts/_collection.erb
|
87
|
+
- app/views/amcharts/_data.erb
|
88
|
+
- app/views/amcharts/_legend.erb
|
89
|
+
- app/views/amcharts/_listener.erb
|
90
|
+
- app/views/amcharts/_object.erb
|
91
|
+
- app/views/amcharts/_settings.erb
|
92
|
+
- app/views/amcharts/_title.erb
|
93
|
+
- app/views/amcharts/chart_builder.erb
|
54
94
|
- lib/amcharts.rb
|
95
|
+
- lib/amcharts/axis.rb
|
96
|
+
- lib/amcharts/axis/category.rb
|
97
|
+
- lib/amcharts/axis/value.rb
|
98
|
+
- lib/amcharts/chart.rb
|
99
|
+
- lib/amcharts/chart/funnel.rb
|
100
|
+
- lib/amcharts/chart/gauge.rb
|
101
|
+
- lib/amcharts/chart/pie.rb
|
102
|
+
- lib/amcharts/chart/radar.rb
|
103
|
+
- lib/amcharts/chart/rectangular.rb
|
104
|
+
- lib/amcharts/chart/serial.rb
|
105
|
+
- lib/amcharts/chart/xy.rb
|
106
|
+
- lib/amcharts/chart_builder.rb
|
107
|
+
- lib/amcharts/chart_builder/function.rb
|
108
|
+
- lib/amcharts/cursor.rb
|
109
|
+
- lib/amcharts/graph.rb
|
110
|
+
- lib/amcharts/legend.rb
|
111
|
+
- lib/amcharts/listener.rb
|
112
|
+
- lib/amcharts/scroll_bar.rb
|
113
|
+
- lib/amcharts/settings.rb
|
114
|
+
- lib/amcharts/uses_settings.rb
|
55
115
|
- lib/amcharts/version.rb
|
116
|
+
- spec/chart/serial_spec.rb
|
117
|
+
- spec/chart_spec.rb
|
56
118
|
- vendor/assets/images/amcharts/dragIcon.gif
|
57
119
|
- vendor/assets/images/amcharts/dragIconH.gif
|
120
|
+
- vendor/assets/images/amcharts/eraserIcon.gif
|
121
|
+
- vendor/assets/images/amcharts/eraserIconH.gif
|
58
122
|
- vendor/assets/images/amcharts/lens.png
|
59
123
|
- vendor/assets/images/amcharts/patterns/black/pattern1.png
|
60
124
|
- vendor/assets/images/amcharts/patterns/black/pattern10.png
|
@@ -105,13 +169,23 @@ files:
|
|
105
169
|
- vendor/assets/images/amcharts/patterns/white/pattern7.png
|
106
170
|
- vendor/assets/images/amcharts/patterns/white/pattern8.png
|
107
171
|
- vendor/assets/images/amcharts/patterns/white/pattern9.png
|
172
|
+
- vendor/assets/images/amcharts/pencilIcon.gif
|
173
|
+
- vendor/assets/images/amcharts/pencilIconH.gif
|
174
|
+
- vendor/assets/images/amcharts/xIcon.gif
|
175
|
+
- vendor/assets/images/amcharts/xIconH.gif
|
176
|
+
- vendor/assets/javascripts/amcharts/all.js
|
108
177
|
- vendor/assets/javascripts/amcharts/amcharts.js
|
178
|
+
- vendor/assets/javascripts/amcharts/amstock.js
|
179
|
+
- vendor/assets/javascripts/amcharts/changeLog.txt
|
109
180
|
- vendor/assets/javascripts/amcharts/funnel.js
|
110
181
|
- vendor/assets/javascripts/amcharts/gauge.js
|
182
|
+
- vendor/assets/javascripts/amcharts/licence.txt
|
111
183
|
- vendor/assets/javascripts/amcharts/pie.js
|
112
184
|
- vendor/assets/javascripts/amcharts/radar.js
|
113
185
|
- vendor/assets/javascripts/amcharts/serial.js
|
186
|
+
- vendor/assets/javascripts/amcharts/thirdPartySoftwareList.txt
|
114
187
|
- vendor/assets/javascripts/amcharts/xy.js
|
188
|
+
- vendor/assets/stylesheets/amcharts/style.css
|
115
189
|
homepage: https://github.com/dvandersluis/amcharts.rb
|
116
190
|
licenses:
|
117
191
|
- MIT
|
@@ -127,14 +201,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
127
201
|
version: '0'
|
128
202
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
129
203
|
requirements:
|
130
|
-
- - ! '
|
204
|
+
- - ! '>='
|
131
205
|
- !ruby/object:Gem::Version
|
132
|
-
version:
|
206
|
+
version: '0'
|
133
207
|
requirements: []
|
134
208
|
rubyforge_project:
|
135
209
|
rubygems_version: 2.1.5
|
136
210
|
signing_key:
|
137
211
|
specification_version: 4
|
138
212
|
summary: Wrapper for Amcharts 3 Javascript charts
|
139
|
-
test_files:
|
213
|
+
test_files:
|
214
|
+
- spec/chart/serial_spec.rb
|
215
|
+
- spec/chart_spec.rb
|
140
216
|
has_rdoc:
|