public
Description: A ruby interface to the Google Chart API
Homepage:
Clone URL: git://github.com/jparker/ruby-googlechart.git
name age message
file .gitignore Wed Nov 12 22:01:40 -0800 2008 Switched from newgem to echoe - simpler gem layout [jparker]
file CHANGELOG Sun Nov 23 02:27:07 -0800 2008 Prepped for 0.6.3 release [jparker]
file README.rdoc Wed Nov 12 22:56:53 -0800 2008 Fixed data scaling bug with all-zero data [jparker]
file Rakefile Sun Nov 23 02:27:07 -0800 2008 Prepped for 0.6.3 release [jparker]
directory lib/ Sun Nov 23 02:22:37 -0800 2008 Redesigned handling of bar grouping. - Bar gro... [jparker]
file ruby-googlechart.gemspec Sun Nov 23 02:27:07 -0800 2008 Prepped for 0.6.3 release [jparker]
directory script/ Thu May 08 22:22:58 -0700 2008 Initial import [jparker]
directory test/ Sun Nov 23 02:22:37 -0800 2008 Redesigned handling of bar grouping. - Bar gro... [jparker]
README.rdoc

ruby-googlechart

DESCRIPTION

ruby-googlechart is a ruby library which provides object-oriented access to the Google Charts API.

This library has largely been done as an exercise. These other ruby libraries are more mature and may be better suited to your needs:

FEATURES

  • Line charts (line, XY, sparkline)
  • Bar charts (horizontal, vertical, grouped, stacked)

SYNOPSIS

  require 'google_chart'

  url = GoogleChart.Line(:data => [1, nil, 2, 8, 1])
  url = GoogleChart.Bar(:data => [5, 23, 6, 14])

  url = GoogleChart.Bar do |c|
    c.axes     = {:x => %w[Q1 Q2 Q3 Q4], :y => 0..400}
    c.data     = [335, 285, 240, 220, 160, 175, 200, 205]
    c.encoding = :extended
    c.scale    = 0..400
    c.size     = '800x375'
    c.style    = :dash
    c.title    = "Are You Pondering What I'm Pondering?"
    c.type     = :line
  end
  url = GoogleChart.Bar do |c|
    c.horizontal = true
    c.grouped    = true
    c.data       = [[5, 6, 7, 8], [23, 14, 17, 16]]
    c.encoding   = :text
    c.title      = 'Lorem Ipsum Dolor'
  end

  chart = GoogleChart::LineChart.new
  chart.type  = :sparkline
  chart.size  = '75x25'
  chart.data  = [1, 1, 2, 3, 5, 8, 13]
  chart.color = 'ff0000'
  url = chart.to_url

REQUIREMENTS

  • Low standards

INSTALL

LICENSE

(The MIT License)

Copyright © 2008 John Parker

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.