The methods and events
We will begin by initializing a chart, adding data, defining a series, and manipulating the chart settings. After we have created a chart to test with we will attach one of the available events.
Initialization of the DHTMLX chart
Same as the other the DHTMLX components we covered, a chart can be attached to a DOM element or a DHTMLX layout cell.
One important thing to know during initialization is that the chart requires a JavaScript object literal as an argument or an exception will occur. This JavaScript object can contain the settings and series for the chart or be left empty, allowing the settings and series to be added later.
dhtmlXChart()
The DOM initialization approach is achieved by creating a new dhtmlXChart
object and setting the JavaScript object argument container
property value to the DOM element's id. This would look like the following code. Do not enter this in the console:
var myChart = new dhtmlXChart({ container: "myContainerId" });
addChart()
The addChart...