barchart.js
Library for drawing Bar charts, using HTML DOM.
Objects
Methods
CSS classes
- .legend
- .legend_box
- .textX
- .textY
Creates a Bar Chart inside div, optObj describes its properties. Its values:
- percentage - bool; is it a percentage plot?
- spacing - int; spacing between columns
- paddingLeft, paddingBottom, paddingTop
- width - int; width of one column
- colors - array of css colors, one for each value set
- border - bool; outline each column?
- grid - bool; show horizontal grid lines?
- gridDesc - bool; show description of lines?
- gridNum - int; approximate number of lines
- shadow - bool; draw shadow for columns?
- shadowColor - css color
- shadowOffset - int; distance between column and its shadow
Adds data to chart. Each value of dataArray describes one column; each column may consist of multiple values. In such case,
dataArray is array of arrays.
Adds horizontal labels.
Adds vertical labels.
Draws the chart.
var chart = new OAT.BarChart("myDiv",{});
chart.attachData([1,3,2]);
chart.attachTextX(["a","b","c"]);
chart.draw();