My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Featured
Downloads

Introduction

Raphael toys aims to extend Raphael JavaScript library with graphs and charts.

The goal of this project is to create a library that is:

  1. Dynamic
  2. Good lookin'
  3. Easy to use
  4. Easy to extend

See the example site for more.

Details

Currently the project consists of 3 JavaScript files which must be included:

  • raphael-toys.js - This is the top level raphael integration.
  • graph-views.js - This contains all the logic for drawing each type of graph.
  • graph-models.js - This contains all data storage for graphs.

Usage

After including the necessary libraries using Raphael Toys is as simple as:

var data = new DataTable();	
	data.add_column("Age");
	data.add_column("Sugar level");
	data.add_column("Coffee level");
	data.add_column("Alcohol level");
	data.add_row([13,99, 20, 5]);	
	data.add_row([15,99, 21, 50]);	
	data.add_row([19,65, 31, 87]);
	data.add_row([22,44, 67, 88]);
	data.add_row([24,31, 73, 69]);
	data.add_row([27,22, 75, 59]);
	data.add_row([29,21, 76, 57]);
	data.add_row([31,20, 75, 56]);	

//Create a line graph
var paper1 = Raphael('line_graph_div', 420, 250);
var line_graph = paper.line_graph();	
line_graph.draw(data);

//Also bar graph
var paper2 = Raphael('bar_graph_div', 420, 250);
var bar_graph = paper.line_graph();	
bar_graph.draw(data);

Requirements

Raphael toys requires Raphael and Prototype to work.

Contribute

This is just started and any help is welcome. Excuse my poor programming. If you are interested in contributing or would like to find out more about development see the RaphaelToysDevelopment wiki page.

Contact

If you want to contact me - drop me a line at drozzy @at gmail! com

Powered by Google Project Hosting