Overview

moochart is a plugin for MooTools 1.2 that draws bubble diagrams on the canvas tag. Future versions might include pie, bar & line graphs.

It was originally developed for an EU-Project on the Adobe AIR platform.

Browser / Platform support

Internet Explorer might work using Google's excanvas. But since time is short and i'm on a mac i havnt been able to test it. If you do please e-mail me!

moochart is released as Open Source under the MIT license.

If you like this script buy yourself a beer from me. Cheers!


Demo

Try adding some bubbles using the sliders or buttons below the graph.

0
0
0
#ff0000

Add random bubbles ranging to -

The chart has a method.

And why not a ?


Usage

Simple chart example.

var myChart = new Chart.Bubble('myChartContainer', { width: 300, height: 200, bubbleSize: 20 }); myChart.addBubble(10, 20, 30, '#fff', 'Bubble 1'); myChart.addBubble(0, 40, 20, '#000', 'Bubble 2'); myChart.redraw();

Documentation

Constructor

Syntax

var myChart = new Chart.Bubble(container [, options]);

Arguments

  1. container - (mixed) A string containing the id of the DOM element that should contain the chart or a reference to an actual DOM element.
  2. options - (object, optional) Chart options, see below.

Options

Method - addBubble

Add a bubble to the chart

Syntax

myChart.addBubble(x, y, z, color, tooltip)

Arguments

  1. x - (number) X-value.
  2. y - (number) Y-value.
  3. z - (number) Z-value.
  4. color - (mixed) Bubble color as css color or array [r, g, b].
  5. tooltip - (string) Tooltip for the graph.

Method - redraw

Redraws bubbles, needs to be called after addBubble for changes to show.

Syntax

myChart.redraw()

Method - empty

Removes all bubbles from graph.

Syntax

myChart.empty()

Download

Dependencies: MooTools 1.2 Core

moochart-0.1b1.js - yui compressed

moochart-0.1b1-nc.js - no compression

Please don't link directly, download and host your own copy.

Changelog

2008-06-25 - 0.1b1 ------------------------------------------ Initial Public Release

Contact

If you have any questions, suggestions or whatever send them to johan@coneri.se


(c) Copyright 2008 Johan Nordberg. All Rights Reserved.