googlecharts 1.5.1 → 1.5.2
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.
- data/Rakefile +20 -20
- data/VERSION +1 -1
- data/lib/gchart.rb +37 -2
- data/website/stylesheets/screen.css +139 -139
- metadata +2 -2
data/Rakefile
CHANGED
@@ -1,20 +1,20 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'rake'
|
3
|
-
|
4
|
-
begin
|
5
|
-
require 'jeweler'
|
6
|
-
Jeweler::Tasks.new do |gemspec|
|
7
|
-
gemspec.name = "googlecharts"
|
8
|
-
gemspec.summary = "Generate charts using Google API & Ruby"
|
9
|
-
gemspec.description = "Generate charts using Google API & Ruby"
|
10
|
-
gemspec.email = "mattaimonetti@gmail.com"
|
11
|
-
gemspec.homepage = "http://googlecharts.rubyforge.org/"
|
12
|
-
gemspec.authors = ["Matt Aimonetti"]
|
13
|
-
end
|
14
|
-
Jeweler::GemcutterTasks.new
|
15
|
-
rescue LoadError
|
16
|
-
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
|
17
|
-
end
|
18
|
-
|
19
|
-
Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }
|
20
|
-
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'jeweler'
|
6
|
+
Jeweler::Tasks.new do |gemspec|
|
7
|
+
gemspec.name = "googlecharts"
|
8
|
+
gemspec.summary = "Generate charts using Google API & Ruby"
|
9
|
+
gemspec.description = "Generate charts using Google API & Ruby"
|
10
|
+
gemspec.email = "mattaimonetti@gmail.com"
|
11
|
+
gemspec.homepage = "http://googlecharts.rubyforge.org/"
|
12
|
+
gemspec.authors = ["Matt Aimonetti"]
|
13
|
+
end
|
14
|
+
Jeweler::GemcutterTasks.new
|
15
|
+
rescue LoadError
|
16
|
+
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
|
17
|
+
end
|
18
|
+
|
19
|
+
Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }
|
20
|
+
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.5.
|
1
|
+
1.5.2
|
data/lib/gchart.rb
CHANGED
@@ -37,7 +37,7 @@ class Gchart
|
|
37
37
|
:title_color, :title_size, :custom, :axis_with_labels, :axis_labels, :bar_width_and_spacing, :id, :alt, :klass,
|
38
38
|
:range_markers, :geographical_area, :map_colors, :country_codes, :axis_range, :filename, :min, :max, :colors
|
39
39
|
|
40
|
-
attr_accessor :bg_type, :bg_color, :bg_angle, :chart_type, :chart_color, :chart_angle, :axis_range
|
40
|
+
attr_accessor :bg_type, :bg_color, :bg_angle, :chart_type, :chart_color, :chart_angle, :axis_range, :thickness, :new_markers, :grid_lines
|
41
41
|
|
42
42
|
attr_accessor :min_value, :max_value
|
43
43
|
|
@@ -90,6 +90,7 @@ class Gchart
|
|
90
90
|
end
|
91
91
|
end
|
92
92
|
|
93
|
+
|
93
94
|
def self.supported_types
|
94
95
|
Gchart.types.join(' ')
|
95
96
|
end
|
@@ -99,6 +100,14 @@ class Gchart
|
|
99
100
|
def size=(size='300x200')
|
100
101
|
@width, @height = size.split("x").map { |dimension| dimension.to_i }
|
101
102
|
end
|
103
|
+
|
104
|
+
def size=(size='300x200')
|
105
|
+
@width, @height = size.split("x").map { |dimension| dimension.to_i }
|
106
|
+
end
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
102
111
|
|
103
112
|
def size
|
104
113
|
"#{width}x#{height}"
|
@@ -242,7 +251,9 @@ class Gchart
|
|
242
251
|
end
|
243
252
|
|
244
253
|
def self.jstize(string)
|
245
|
-
|
254
|
+
# See discussion: http://github.com/mattetti/googlecharts/commit/9b5cfb93aa51aae06611057668e631cd515ec4f3#comment_51347
|
255
|
+
# string.gsub(' ', '+').gsub(/\[|\{|\}|\\|\^|\[|\]|\`|\]/) {|c| "%#{c[0].to_s.upcase}"}
|
256
|
+
string.gsub(' ', '+').gsub(/\[|\{|\}|\||\\|\^|\[|\]|\`|\]/) {|c| "%#{c[0].to_s.upcase}"}
|
246
257
|
end
|
247
258
|
# load all the custom aliases
|
248
259
|
require 'gchart/aliases'
|
@@ -396,6 +407,18 @@ class Gchart
|
|
396
407
|
|
397
408
|
end
|
398
409
|
|
410
|
+
def set_line_thickness
|
411
|
+
"chls=#{thickness}"
|
412
|
+
end
|
413
|
+
|
414
|
+
def set_line_markers
|
415
|
+
"chm=#{new_markers}"
|
416
|
+
end
|
417
|
+
|
418
|
+
def set_grid_lines
|
419
|
+
"chg=#{grid_lines}"
|
420
|
+
end
|
421
|
+
|
399
422
|
def set_labels
|
400
423
|
if legend.is_a?(Array)
|
401
424
|
"chl=#{@legend.map{|label| "#{CGI::escape(label.to_s)}"}.join('|')}"
|
@@ -426,6 +449,8 @@ class Gchart
|
|
426
449
|
"#{index}:|#{labels}"
|
427
450
|
end
|
428
451
|
end
|
452
|
+
count = labels_arr.length
|
453
|
+
|
429
454
|
"chxl=#{labels_arr.join('|')}"
|
430
455
|
end
|
431
456
|
|
@@ -446,6 +471,10 @@ class Gchart
|
|
446
471
|
nil
|
447
472
|
end
|
448
473
|
end
|
474
|
+
|
475
|
+
|
476
|
+
|
477
|
+
|
449
478
|
|
450
479
|
def set_geographical_area
|
451
480
|
"chtm=#{geographical_area}"
|
@@ -618,6 +647,10 @@ class Gchart
|
|
618
647
|
set_title unless title.nil?
|
619
648
|
when '@legend'
|
620
649
|
set_legend unless legend.nil?
|
650
|
+
when '@thickness'
|
651
|
+
set_line_thickness
|
652
|
+
when '@new_markers'
|
653
|
+
set_line_markers
|
621
654
|
when '@bg_color'
|
622
655
|
set_colors
|
623
656
|
when '@chart_color'
|
@@ -632,6 +665,8 @@ class Gchart
|
|
632
665
|
set_axis_labels
|
633
666
|
when '@range_markers'
|
634
667
|
set_range_markers
|
668
|
+
when '@grid_lines'
|
669
|
+
set_grid_lines
|
635
670
|
when '@geographical_area'
|
636
671
|
set_geographical_area
|
637
672
|
when '@country_codes'
|
@@ -1,139 +1,139 @@
|
|
1
|
-
body {
|
2
|
-
background-color: #E1D1F1;
|
3
|
-
font-family: "Georgia", sans-serif;
|
4
|
-
font-size: 16px;
|
5
|
-
line-height: 1.6em;
|
6
|
-
padding: 1.6em 0 0 0;
|
7
|
-
color: #333;
|
8
|
-
}
|
9
|
-
h1, h2, h3, h4, h5, h6 {
|
10
|
-
color: #444;
|
11
|
-
}
|
12
|
-
h1 {
|
13
|
-
font-family: sans-serif;
|
14
|
-
font-weight: normal;
|
15
|
-
font-size: 4em;
|
16
|
-
line-height: 0.8em;
|
17
|
-
letter-spacing: -0.1ex;
|
18
|
-
margin: 5px;
|
19
|
-
}
|
20
|
-
li {
|
21
|
-
padding: 0;
|
22
|
-
margin: 0;
|
23
|
-
list-style-type: square;
|
24
|
-
}
|
25
|
-
a {
|
26
|
-
color: #5E5AFF;
|
27
|
-
background-color: #DAC;
|
28
|
-
font-weight: normal;
|
29
|
-
text-decoration: underline;
|
30
|
-
}
|
31
|
-
blockquote {
|
32
|
-
font-size: 90%;
|
33
|
-
font-style: italic;
|
34
|
-
border-left: 1px solid #111;
|
35
|
-
padding-left: 1em;
|
36
|
-
}
|
37
|
-
.caps {
|
38
|
-
font-size: 80%;
|
39
|
-
}
|
40
|
-
|
41
|
-
#main {
|
42
|
-
width: 45em;
|
43
|
-
padding: 0;
|
44
|
-
margin: 0 auto;
|
45
|
-
}
|
46
|
-
.coda {
|
47
|
-
text-align: right;
|
48
|
-
color: #77f;
|
49
|
-
font-size: smaller;
|
50
|
-
}
|
51
|
-
|
52
|
-
table {
|
53
|
-
font-size: 90%;
|
54
|
-
line-height: 1.4em;
|
55
|
-
color: #ff8;
|
56
|
-
background-color: #111;
|
57
|
-
padding: 2px 10px 2px 10px;
|
58
|
-
border-style: dashed;
|
59
|
-
}
|
60
|
-
|
61
|
-
th {
|
62
|
-
color: #fff;
|
63
|
-
}
|
64
|
-
|
65
|
-
td {
|
66
|
-
padding: 2px 10px 2px 10px;
|
67
|
-
}
|
68
|
-
|
69
|
-
.success {
|
70
|
-
color: #0CC52B;
|
71
|
-
}
|
72
|
-
|
73
|
-
.failed {
|
74
|
-
color: #E90A1B;
|
75
|
-
}
|
76
|
-
|
77
|
-
.unknown {
|
78
|
-
color: #995000;
|
79
|
-
}
|
80
|
-
pre, code {
|
81
|
-
font-family: monospace;
|
82
|
-
font-size: 90%;
|
83
|
-
line-height: 1.4em;
|
84
|
-
color: #ff8;
|
85
|
-
background-color: #111;
|
86
|
-
padding: 2px 10px 2px 10px;
|
87
|
-
overflow: auto;
|
88
|
-
}
|
89
|
-
.comment { color: #aaa; font-style: italic; }
|
90
|
-
.keyword { color: #eff; font-weight: bold; }
|
91
|
-
.punct { color: #eee; font-weight: bold; }
|
92
|
-
.symbol { color: #0bb; }
|
93
|
-
.string { color: #6b4; }
|
94
|
-
.ident { color: #ff8; }
|
95
|
-
.constant { color: #66f; }
|
96
|
-
.regex { color: #ec6; }
|
97
|
-
.number { color: #F99; }
|
98
|
-
.expr { color: #227; }
|
99
|
-
|
100
|
-
#version {
|
101
|
-
float: right;
|
102
|
-
text-align: right;
|
103
|
-
font-family: sans-serif;
|
104
|
-
font-weight: normal;
|
105
|
-
background-color: #B3ABFF;
|
106
|
-
color: #141331;
|
107
|
-
padding: 15px 20px 10px 20px;
|
108
|
-
margin: 0 auto;
|
109
|
-
margin-top: 15px;
|
110
|
-
border: 3px solid #141331;
|
111
|
-
}
|
112
|
-
|
113
|
-
#version .numbers {
|
114
|
-
display: block;
|
115
|
-
font-size: 4em;
|
116
|
-
line-height: 0.8em;
|
117
|
-
letter-spacing: -0.1ex;
|
118
|
-
margin-bottom: 15px;
|
119
|
-
}
|
120
|
-
|
121
|
-
#version p {
|
122
|
-
text-decoration: none;
|
123
|
-
color: #141331;
|
124
|
-
background-color: #B3ABFF;
|
125
|
-
margin: 0;
|
126
|
-
padding: 0;
|
127
|
-
}
|
128
|
-
|
129
|
-
#version a {
|
130
|
-
text-decoration: none;
|
131
|
-
color: #141331;
|
132
|
-
background-color: #B3ABFF;
|
133
|
-
}
|
134
|
-
|
135
|
-
.clickable {
|
136
|
-
cursor: pointer;
|
137
|
-
cursor: hand;
|
138
|
-
}
|
139
|
-
|
1
|
+
body {
|
2
|
+
background-color: #E1D1F1;
|
3
|
+
font-family: "Georgia", sans-serif;
|
4
|
+
font-size: 16px;
|
5
|
+
line-height: 1.6em;
|
6
|
+
padding: 1.6em 0 0 0;
|
7
|
+
color: #333;
|
8
|
+
}
|
9
|
+
h1, h2, h3, h4, h5, h6 {
|
10
|
+
color: #444;
|
11
|
+
}
|
12
|
+
h1 {
|
13
|
+
font-family: sans-serif;
|
14
|
+
font-weight: normal;
|
15
|
+
font-size: 4em;
|
16
|
+
line-height: 0.8em;
|
17
|
+
letter-spacing: -0.1ex;
|
18
|
+
margin: 5px;
|
19
|
+
}
|
20
|
+
li {
|
21
|
+
padding: 0;
|
22
|
+
margin: 0;
|
23
|
+
list-style-type: square;
|
24
|
+
}
|
25
|
+
a {
|
26
|
+
color: #5E5AFF;
|
27
|
+
background-color: #DAC;
|
28
|
+
font-weight: normal;
|
29
|
+
text-decoration: underline;
|
30
|
+
}
|
31
|
+
blockquote {
|
32
|
+
font-size: 90%;
|
33
|
+
font-style: italic;
|
34
|
+
border-left: 1px solid #111;
|
35
|
+
padding-left: 1em;
|
36
|
+
}
|
37
|
+
.caps {
|
38
|
+
font-size: 80%;
|
39
|
+
}
|
40
|
+
|
41
|
+
#main {
|
42
|
+
width: 45em;
|
43
|
+
padding: 0;
|
44
|
+
margin: 0 auto;
|
45
|
+
}
|
46
|
+
.coda {
|
47
|
+
text-align: right;
|
48
|
+
color: #77f;
|
49
|
+
font-size: smaller;
|
50
|
+
}
|
51
|
+
|
52
|
+
table {
|
53
|
+
font-size: 90%;
|
54
|
+
line-height: 1.4em;
|
55
|
+
color: #ff8;
|
56
|
+
background-color: #111;
|
57
|
+
padding: 2px 10px 2px 10px;
|
58
|
+
border-style: dashed;
|
59
|
+
}
|
60
|
+
|
61
|
+
th {
|
62
|
+
color: #fff;
|
63
|
+
}
|
64
|
+
|
65
|
+
td {
|
66
|
+
padding: 2px 10px 2px 10px;
|
67
|
+
}
|
68
|
+
|
69
|
+
.success {
|
70
|
+
color: #0CC52B;
|
71
|
+
}
|
72
|
+
|
73
|
+
.failed {
|
74
|
+
color: #E90A1B;
|
75
|
+
}
|
76
|
+
|
77
|
+
.unknown {
|
78
|
+
color: #995000;
|
79
|
+
}
|
80
|
+
pre, code {
|
81
|
+
font-family: monospace;
|
82
|
+
font-size: 90%;
|
83
|
+
line-height: 1.4em;
|
84
|
+
color: #ff8;
|
85
|
+
background-color: #111;
|
86
|
+
padding: 2px 10px 2px 10px;
|
87
|
+
overflow: auto;
|
88
|
+
}
|
89
|
+
.comment { color: #aaa; font-style: italic; }
|
90
|
+
.keyword { color: #eff; font-weight: bold; }
|
91
|
+
.punct { color: #eee; font-weight: bold; }
|
92
|
+
.symbol { color: #0bb; }
|
93
|
+
.string { color: #6b4; }
|
94
|
+
.ident { color: #ff8; }
|
95
|
+
.constant { color: #66f; }
|
96
|
+
.regex { color: #ec6; }
|
97
|
+
.number { color: #F99; }
|
98
|
+
.expr { color: #227; }
|
99
|
+
|
100
|
+
#version {
|
101
|
+
float: right;
|
102
|
+
text-align: right;
|
103
|
+
font-family: sans-serif;
|
104
|
+
font-weight: normal;
|
105
|
+
background-color: #B3ABFF;
|
106
|
+
color: #141331;
|
107
|
+
padding: 15px 20px 10px 20px;
|
108
|
+
margin: 0 auto;
|
109
|
+
margin-top: 15px;
|
110
|
+
border: 3px solid #141331;
|
111
|
+
}
|
112
|
+
|
113
|
+
#version .numbers {
|
114
|
+
display: block;
|
115
|
+
font-size: 4em;
|
116
|
+
line-height: 0.8em;
|
117
|
+
letter-spacing: -0.1ex;
|
118
|
+
margin-bottom: 15px;
|
119
|
+
}
|
120
|
+
|
121
|
+
#version p {
|
122
|
+
text-decoration: none;
|
123
|
+
color: #141331;
|
124
|
+
background-color: #B3ABFF;
|
125
|
+
margin: 0;
|
126
|
+
padding: 0;
|
127
|
+
}
|
128
|
+
|
129
|
+
#version a {
|
130
|
+
text-decoration: none;
|
131
|
+
color: #141331;
|
132
|
+
background-color: #B3ABFF;
|
133
|
+
}
|
134
|
+
|
135
|
+
.clickable {
|
136
|
+
cursor: pointer;
|
137
|
+
cursor: hand;
|
138
|
+
}
|
139
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: googlecharts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Aimonetti
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-
|
12
|
+
date: 2010-02-28 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|