= Ruby/GDChart 1.0.0
This is an extension library designed by Arjen Laarhoven, Takehiro
Yonekura, and most recently Daniel Wislocki, to wrap the GDChart C library
written by Bruce Verderaime (http://www.fred.net/brv/chart/). Arjen
Laarhoven wrote the original version back in 2000, and Takehiro Yonekura
updated it in 2002. Compared to them, I've done relatively little other
than to turn the package into a gem, add a few missing (but extremely
important) constant definitions, and upgrade the GDChart library itself to
0.11.5dev. (Note: The C library that this gem wraps is included, but
requires the installation of gd-2.0.28 or higher.)
== A Brief Example
The following example creates a simple 200x200 PNG chart and writes it to
STDOUT:
require 'rubygems'
require_gem 'ruby-gdchart'
GDChart.title = "A Chart"
GDChart.xtitle = "X-axis"
GDChart.ytitle = "Y-axis"
data = [1, 2, 3, 4, 5, 6]
the wrong number of labels cause Ruby/GDChart to segfault!
labels = ["label 1", "label 2", "label 3", "label 4", "label 5", "label 6"]
numpoints = 6
numsets = 1
xsize = 200
ysize = 200
GDChart.out_graph(xsize, ysize, $stdout, GDChart::LINE, numpoints,
labels, numsets, data)
== Caveats
This library works, but there has been practically no testing.
Documentation is also extremely sparse (this goes for the original C
library as well), which I hope to rectify in the future. It's recommended
that you take a look at Bruce Verderaime's page
(http://www.fred.net/brv/chart/) to get a good sense of how the library
works, since the extension has an almost 1-1 mapping with the C library.
== License
This extension is distributed under the same terms as Ruby (see
http://www.ruby-lang.org/en/LICENSE.txt. The included gd-1.8.3 (needed by
GDCHART) and gdchart0.11.5dev libraries have their own license terms.