Skip to content
This repository has been archived by the owner on May 11, 2021. It is now read-only.

Graphie Helper Functions

kramtark edited this page Oct 31, 2011 · 9 revisions

graphie-helpers

rectchart( divisions, colors[, row #] )

Produces a single row of blocks which may be divided into several sections and colors. To make multiple rows, you must use the "row #" field to specify which row it is for formatting purposes.

init({ range: [ [0, 1], [0, 30] ], scale: [250, 25] });
rectchart( [10, 5], ["#28AE7B", "#999"] )

rectchart()

Unasked Questions

Those figures are drawn "manually" using the tools from graphie.js; specifically, path() and arc(). Here is the code used in that exercise to draw a "cube":

init({
    range: [ [-1, 4], [-0.6, 3.1] ]
});
path([ [0, 0], [0, 2], [2, 2], [2, 0], true ]);
path([ [2, 0], [3, 1], [3, 3], [1, 3], [0, 2] ]);
path([ [2, 2], [3, 3] ]);

Manually drawn cube