Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed: extended encoding fails if the max value is zero [Graeme Stuart]

  • Loading branch information...
commit be3736ce7b015cf1d0bd18e818f4405607710599 1 parent 799a787
@mattetti mattetti authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/gchart.rb
View
2  lib/gchart.rb
@@ -431,7 +431,7 @@ def convert_to_extended_value(number)
def extended_encoding
@max_value = dataset.compact.map{|ds| ds.compact.max}.max if @max_value == 'auto'
- if @max_value == false || @max_value == 'false' || @max_value == :false
+ if @max_value == false || @max_value == 'false' || @max_value == :false || @max_value == 0
"e:" + dataset.map { |ds| ds.map { |number| number.nil? ? '__' : convert_to_extended_value(number)}.join }.join(',')
else
"e:" + dataset.map { |ds| ds.map { |number| number.nil? ? '__' : convert_to_extended_value( (@@ext_pairs.size - 1) * number / @max_value) }.join }.join(',')
Please sign in to comment.
Something went wrong with that request. Please try again.