Chart class that holds all the generic information for each chart that is being created.
The constructor expects the id or reference for a DOM object (preferrably a div) and an optional set of object properties. NOTE: The contents of the DOM object will be cleared before rendering the chart.
Constructor
EJSC.Chart( string id [, object options] ) EJSC.Chart( DOMObject object [, object options] )
Example
var myChart = new EJSC.Chart("chart", {title:"My Chart"});
or
var myChartDiv = document.getElementById("myChart"); var myChart = new EJSC.Chart(myChartDiv, {title:"My Chart"});
Defining Chart Properties and Events
Chart properties may be set individually after the chart has been created or in batch using the options parameter during instantiation.
Setting properties individually
var myChart = new EJSC.Chart("chartDIV"); myChart.allow_zoom = false; myChart.show_legend = false; myChart.onDblClickPoint = function(point) { alert("Point Clicked: " + point.x + "," + point.y); }
Setting properties in batch
var myChart = new EJSC.Chart( "chartDIV", { allow_zoom: false, show_legend: false, onDblClickPoint: function(point) { alert("Point Clicked: " + point.x + "," + point.y); } } ); |