ghazel-googlecharts 1.4.0.2 → 1.4.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/gchart.rb +10 -3
- metadata +1 -1
data/lib/gchart.rb
CHANGED
@@ -137,14 +137,21 @@ class Gchart
|
|
137
137
|
def full_data_range(ds)
|
138
138
|
return if @max_value == false
|
139
139
|
|
140
|
-
ds.
|
140
|
+
ds.each_with_index do |mds, mds_index|
|
141
141
|
# global limits override individuals. is this preferred?
|
142
142
|
mds[:min_value] = @min_value if not @min_value.nil?
|
143
143
|
mds[:max_value] = @max_value if not @max_value.nil?
|
144
144
|
|
145
145
|
# TODO: can you have grouped stacked bars?
|
146
|
-
|
147
|
-
|
146
|
+
|
147
|
+
if mds_index == 0 and @type == :bar
|
148
|
+
# TODO: unless you specify a zero line (using chp or chds),
|
149
|
+
# the min_value of a bar chart is always 0.
|
150
|
+
#mds[:min_value] ||= mds[:data].first.to_a.compact.min
|
151
|
+
mds[:min_value] ||= 0
|
152
|
+
end
|
153
|
+
if (mds_index == 0 and @type == :bar and
|
154
|
+
not grouped and mds[:data].first.is_a?(Array))
|
148
155
|
totals = []
|
149
156
|
mds[:data].each do |l|
|
150
157
|
l.each_with_index do |v, index|
|