Skip to content

Commit

Permalink
Fixing the "defaults" on maps.
Browse files Browse the repository at this point in the history
  • Loading branch information
jqr committed May 30, 2009
1 parent c424ab2 commit aaac143
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion example/example.html
@@ -1 +1 @@
<html><body><img src="http://chart.apis.google.com/chart?chs=300x200&cht=lc&chd=e:AAGa.." /><br /><img src="http://chart.apis.google.com/chart?chs=60x20&cht=ls&chd=e:GaTNDNAAmZ.." /><br /><img src="http://chart.apis.google.com/chart?chs=300x200&cht=bhs&chd=e:ApGa.." /><br /><img src="http://chart.apis.google.com/chart?chs=300x200&cht=p&chd=e:-H-H.." /><br /><img src="http://chart.apis.google.com/chart?chs=300x200&cht=v&chd=e:..zMmZTNTNTNGa" /><br /><img src="http://chart.apis.google.com/chart?chs=300x200&cht=s&chd=e:MzZmmZzM..,..zMmZZmMz,MzZmmZzM.." /><br /><img src="http://chart.apis.google.com/chart?chf=bg,s,dfdfff&chs=440x220&cht=t&chco=ffffff,f8fcf8,006c00&chld=VANYCA&chtm=world&chd=e:..VVqq" /><br /><img src="http://chart.apis.google.com/chart?chs=300x200&cht=gom&chl=70%25&chd=t:70.0" /><br /><img src="http://chart.apis.google.com/chart?chs=300x200&cht=lc&chtt=Awesomeness+over+Time&chd=e:AAGa.." /><br /><img src="http://chart.apis.google.com/chart?chdl=Monkeys%7CFerrets&chs=300x200&cht=lc&chd=e:QAgA,v..." /><br /><img src="http://chart.apis.google.com/chart?chs=300x200&cht=lc&chco=ff0000,0000ff&chd=e:AAGa..,..GaAA" /><br /></body></html>
<html><body><img src="http://chart.apis.google.com/chart?chs=300x200&cht=lc&chd=e:AAGa.." /><br /><img src="http://chart.apis.google.com/chart?chs=300x200&cht=ls&chd=e:GaTNDNAAmZ.." /><br /><img src="http://chart.apis.google.com/chart?chs=300x200&cht=bhs&chd=e:ApGa.." /><br /><img src="http://chart.apis.google.com/chart?chs=300x200&cht=p&chd=e:-H-H.." /><br /><img src="http://chart.apis.google.com/chart?chs=300x200&cht=v&chd=e:..zMmZTNTNTNGa" /><br /><img src="http://chart.apis.google.com/chart?chs=300x200&cht=s&chd=e:MzZmmZzM..,..zMmZZmMz,MzZmmZzM.." /><br /><img src="http://chart.apis.google.com/chart?chf=bg,s,dfdfff&chs=300x200&cht=t&chco=ffffff,f8fcf8,006c00&chld=VANYCA&chtm=usa&chd=e:..VVqq" /><br /><img src="http://chart.apis.google.com/chart?chs=300x200&cht=gom&chl=70%25&chd=t:70.0" /><br /><img src="http://chart.apis.google.com/chart?chs=300x200&cht=lc&chtt=Awesomeness+over+Time&chd=e:AAGa.." /><br /><img src="http://chart.apis.google.com/chart?chdl=Monkeys%7CFerrets&chs=300x200&cht=lc&chd=e:QAgA,v..." /><br /><img src="http://chart.apis.google.com/chart?chs=300x200&cht=lc&chco=ff0000,0000ff&chd=e:AAGa..,..GaAA" /><br /></body></html>
10 changes: 5 additions & 5 deletions lib/gchart/map.rb
Expand Up @@ -8,13 +8,13 @@ class Map < GChart::Base
def initialize(*args, &block)
super(*args, &block)
# Set some sane defaults so that the only requirement is data
@area = 'world' #default
@background = 'dfdfff' #make it look like water
@colors = ['ffffff','f8fcf8','006c00']
@area ||= 'world' #default
@background ||= 'dfdfff' #make it look like water
@colors ||= ['ffffff','f8fcf8','006c00']
#Set the maximum size for maps (this is a better default because
# it is also the proper aspect ratio)
@width = '440'
@height = '220'
@width ||= '440'
@height ||= '220'
end

# Map data can be in the form {"VA'=>5,'NY'=>1} or [['VA',5],['NY',1]]
Expand Down

0 comments on commit aaac143

Please sign in to comment.