%META:TOPICPARENT{name="OATDOCIndex"}%
---+ piechart.js

Library for drawing Pie charts using SVG.

%TOC%

---++ Objects

---+++ OAT.PieChart(div, options)

Creates a Pie Chart inside specified <tt>div</tt>. You can specify the following <tt>options</tt>:

   * <tt>*radius*</tt> - int; if 0, then radius is computed automatically
   * <tt>*depth*</tt> - int; height of pie
   * <tt>*width*</tt> - int; if 0, then width is computed automatically
   * <tt>*height*</tt> - int; if 0, then height is computed automatically
   * <tt>*legend* </tt>- bool; should we draw the legend? default true
   * <tt>ToBeDone</tt>  (this has the wrong option name) <tt>*ycoef*</tt> - float; how much skewing should be applied?
   * <tt>*left*</tt> ,<tt>*top*</tt> - position, default 30,  40
   * <tt>*ycoef*</tt> - coefficient for the y axis (default0.7)

---++ Methods

---+++ OAT.PieChart::attachData(dataArray)

Adds data to chart.

---+++ OAT.PieChart::attachText(textArray)

Adds legend labels.

---+++ OAT.PieChart::attachColors(colorArray)

Adds colors.

---+++ OAT.PieChart::draw()

Draws the chart.

<verbatim>
var chart = new OAT.PieChart("myDiv",{});
chart.attachData([1,3,2]);
chart.attachText(["a","b","c"]);
chart.attachColors(["#f00","#0f0","#00f"]);
chart.draw();
</verbatim>

CategoryDocumentation CategoryOAT CategoryOpenSource CategoryToBeDone