Google Charts and Rebol

There’s very few ways to conveniently include a chart in a web page or document than to use the Google Charts API. However, it’s really not that much fun stitching together the constituent parts of a good looking chart. Enter Rebol.

Usage

This script allows you to build Google Charts using more familiar, readable terms than editing the URL. However, an understanding of the basic methods of the API is understood.

The ‘chart function returns a URL that is ready to use. It can be embedded in HTML, copied and pasted to a browser or included in a Rebol/View application. Indeed, it’s easy enough to view any of these examples in Rebol/View:

view layout [image chart [...]]

Basic Line Chart

‘Line’ is the default Chart Type. If you only provide data, you will get the resulting image:

chart [data: [10 95 60 95 10]]

Basic Bar Chart

Types can be specified, either by the preset words (line, line/xy, sparkline, bar, bar/horizontal, pie, pie/flat, map) or by the chart types set in the Google API:

chart [type: 'bar data: [10 95 60 95 10] bars: [55 8]]

Data Sets

Data can be supplied as a single or multiple sets. The default scale is 0-100.