I must be missing something simple, but...: In the ZingChart docs for the API methods, the functions all reference myid, but I can't figure out what is a ZingChart's id. For example, method getseriesvalues:
zingchart.exec('myid', 'getseriesvalues', {});
What does 'myid' refer to in this example code?
Here is my simple ZingChart example code:
$(function(){
var myChart = {
type : "line",
title : {text: "Hello ZingChart World!"},
series : [
{values:[5, 10, 15, 5, 10, 5]},
{values:[2, 4, 6, 8, 10, 12]}
]
};
zingchart.render({
id : "myChartDiv",
height : 450,
width : 600,
data : myChart
});
})
Now let's say I would want to invoke the getseriesvalues method on this chart - what would myid be? myChart? myChartDiv? Neither of them work...
The
idproperty references the<div>element'sidproperty in which the chart is injected. See the ZingChart "Getting Started" guide.Example:
It also used for other ZingChart methods (e.g., to subsequently bind events to your chart). For example, to get the values after initiation for this chart:
You can think of
idas a global variable—always referencing the same chart by name, no matter its place in the code.