PlotKit Home | <<

PlotKit EasyPlot

EasyPlot is a wrapper around the various PlotKit classes to allow you to get a chart plotted as quick as possible with as little code as possible. Using EasyPlot, you will get a chart started with just a single line.


PlotKit.EasyPlot(style, options, divElement, datasourceArray)

EasyPlot object will automatically choose the supported render method, currently Canvas or SVG in that order, and render the datasources given in datasourceArray.


EasyPlot Example

<div id="example" style="margin: 0 auto 0 auto;" width="400" height="400"></div>

<script type="text/javascript">
var data = [[0,0], [1,2], [2,3], [3, 7], [4, 8], [5, 6]];
var plotter = EasyPlot("line", {}, $("example"), [data, "sample.txt"]);

In this example, two datasets are passed, one defined as a 2D array and another which is a comma separated text file (CSV) at the location "sample.txt". A demonstration of this is found in the QuickStartEasy example.