barchart.js

Library for drawing bar charts, using HTML DOM.

Objects

OAT.BarChart(div, optObj)

Creates a Bar Chart inside div; optObj describes its properties. optObj values:

Methods

OAT.BarChart::attachData(dataArray)

Adds data to chart. Each value of dataArray describes one column; each column may consist of multiple values. In such case, dataArray is an array of arrays.

OAT.BarChart::attachTextX(textArray)

Adds horizontal labels.

OAT.BarChart::attachTextY(textArray)

Adds vertical labels.

OAT.BarChart::draw()

Draws the chart.

CSS classes

.legend

CSS class of legend div.

.legend_box

CSS class of boxes with bar color, positioned left from the value description text.

.textX

CSS class of X axis description.

.textY

CSS class of Y axis description.

Example


var chart = new OAT.BarChart("myDiv",{});
chart.attachData([1,3,2]);
chart.attachTextX(["a","b","c"]);
chart.draw();

CategoryDocumentation CategoryOAT CategoryOpenSource