No commit activity in last 3 years
No release in over 3 years
Ruby wrapper around the Google Charts API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0
 Project Readme

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¶ ↑

  • sudo gem install ruby-googlechart