Closed lukeredpath closed 14 years ago
$ irb
require 'lib/gchart' => true Gchart.sparkline(:legend => %w{foo bar baz}) => "http://chart.apis.google.com/chart?chdl=foo|bar|baz&cht=ls&chs=300x200&chxr=0"
Are you sure you're on the latest version? 1.5.3
I also tried the gem:
$ irb
>> require 'googlecharts'
=> true
>> Gchart.sparkline(:legend => %w{foo bar baz})
=> "http://chart.apis.google.com/chart?chdl=foo|bar|baz&cht=ls&chs=300x200&chxr=0"
As I mentioned on Twitter, I can confirm this is fixed in 1.5.3; I'm using bundled gems and hadn't reloaded Passenger so it was still picking up the old gem when I tried this (despite doing a bundle install). My bad.
No worries, thanks for the report tho, much appreciated.
When generating a sparkline or line graph (this may also happen with other types but not tested), parsing an array of legend labels doesn't work properly:
This generates a URL that contains the following string:
Passing in a single-element array containing a pipe-delimited string seems to work as expected:
Produces:
Passing in just a pipe-delimited string fails too; it needs to be a single-element array.