Graph Information

Methods that return information about the graph. This ranges from specific pieces of JSON information, to the whole chart configuration object.

getcharttype

Returns the chart's type.


          
zingchart.exec('myid', 'getcharttype', {
    graphid : 0
});
        

          
zingchart.exec('myid', 'getcharttype', {
    graphid : "mygraph"
});
        
AttributeTypeInfo

graphid (optional)

Mixed

The id/index of the graph. The default is 0.

"mygraph" | 0 | 1 | ...

getdata

Returns the entire JSON.


          
zingchart.exec('myid', 'getdata');
        
A ZingChart Embedded Demohttps://app.zingsoft.com/demos/embed/ANYULDY8

getgraphlength

Returns the number of graphs in the chart.


          
zingchart.exec('myid', 'getgraphlength');
        
A ZingChart Embedded Demohttps://app.zingsoft.com/demos/embed/BNKAM9JP

getnodelength

Returns the number of nodes in a given plot.


          
zingchart.exec('myid', 'getnodelength', {
    graphid : 0,
    plotindex : 2
});
        
A ZingChart Embedded Demohttps://app.zingsoft.com/demos/embed/A5X1OHIF
AttributeTypeInfo

graphid (optional)

Mixed

The id/index of the graph. The default is 0.

"mygraph" | 0 | 1 | ...

plotindex

Numeric

The index of the plot.

0 | 1 | ...

getnodevalue

Returns the value of the given node.


          
zingchart.exec('myid', 'getnodevalue', {
    graphid : 0,
    plotindex : 2,
    nodeindex : 10
});
        
A ZingChart Embedded Demohttps://app.zingsoft.com/demos/embed/HWB7MX29
AttributeTypeInfo

graphid (optional)

Mixed

The id/index of the graph. The default is 0.

"mygraph" | 0 | 1 | ...

nodeindex

Numeric

The index in the specified plot of the node.

0 | 8 | 20 | ...

plotindex

Numeric

The index of the plot.

0 | 1 | ...

getobjectinfo

Returns various attributes for specific chart elements (graph, plotarea, scale, plot, node). Depending on the object requested, a subset of the following attributes will be returned: x, y, width, height, lineColor, lineWidth, borderColor, borderWidth, backgroundColor1, backgroundColor2, text, values, minValue, maxValue, step, stepSize.


          
zingchart.exec('myid', 'getobjectinfo', {
    object : 'graph'
});
        

          
zingchart.exec('myid', 'getobjectinfo', {
    object : 'scale',
    name : 'scale-x'
});
        
A ZingChart Embedded Demohttps://app.zingsoft.com/demos/embed/I2QLSC3R
AttributeTypeInfo

graphid (optional)

Mixed

The id/index of the graph. The default is 0.

"mygraph" | 0 | 1 | ...

name

String

The name of the scale if object is "scale".

"scale-x" | "..."

nodeindex

Numeric

The index in the specified plot where the new node should go. The current values will be shifted. If this parameter is not set, it is placed at the end.

0 | 8 | 20 | ...

object

String

"graph" | "plotarea" | "scale" | "plot" | "node"

plotid

String

The id of the plot to add data to.

"mylineplot" | ...

plotindex

Numeric

The index of the plot to add data to.

0 | 1 | ...

getplotlength

Returns the number of plots in a given graph.


          
zingchart.exec('myid', 'getplotlength', {
    graphid : 0
});
        
A ZingChart Embedded Demohttps://app.zingsoft.com/demos/embed/U8KC1IKE
AttributeTypeInfo

graphid (optional)

Mixed

The id/index of the graph. The default is 0.

"mygraph" | 0 | 1 | ...

getplotvalues

Returns the value of the given plot.


          
zingchart.exec('myid', 'getplotvalues', {
    graphid : 0,
    plotindex : 2
});
        
A ZingChart Embedded Demohttps://app.zingsoft.com/demos/embed/92VX2DTO
AttributeTypeInfo

graphid (optional)

Mixed

The id/index of the graph. The default is 0.

"mygraph" | 0 | 1 | ...

plotindex

Numeric

The index of the plot.

0 | 1 | ...

getrender

Returns the render mode (canvas/svg/vml).


          
zingchart.exec('myid', 'getrender');
        
A ZingChart Embedded Demohttps://app.zingsoft.com/demos/embed/6FBLYC02

getrules

Returns an array containing the ids of the existing rules in a chart.


          
zingchart.exec('myid', 'getrules',{
    plotindex:0
});
        
A ZingChart Embedded Demohttps://app.zingsoft.com/demos/embed/DGNYHJNB
AttributeTypeInfo

graphid (optional)

Mixed

The id/index of the graph. The default is 0.

"mygraph" | 0 | 1 | ...

plotindex

Numeric

The index of the plot containing the rules to be returned.

0 | 1 | ...

getscales

Returns an array containing the names of the active scales on the chart.


          
zingchart.exec('myid', 'getscales');
        
A ZingChart Embedded Demohttps://app.zingsoft.com/demos/embed/SINOBCJI
AttributeTypeInfo

graphid (optional)

Mixed

The id/index of the graph. The default is 0.

"mygraph" | 0 | 1 | ...

getversion/showversion

Returns the version of the library currently being used.


          
zingchart.exec('myid', 'getversion');
        
A ZingChart Embedded Demohttps://app.zingsoft.com/demos/embed/F4E921OY

getxyinfo

Returns various scale and node related information based on x and y positions in the chart. The returned data is an Array of objects holding information relative to key scales, value scales and node proximity.


          
zingchart.exec('myid', 'getxyinfo', {
    x : 280,
    y : 120
});
        
A ZingChart Embedded Demohttps://app.zingsoft.com/demos/embed/LU2LXDGC
AttributeTypeInfo

x

Numeric

The x position.

5 | 10 | ...

y

Numeric

The y position.

5 | 10 | ...

get3dview

Returns an object containing the 3d chart view information. True3d is 1 if not a 3d graph, else true3d returns a boolean value of true if 3d graph.


          
zingchart.exec('myid', 'get3dview',{
    plotindex:0
});
        
A ZingChart Embedded Demohttps://app.zingsoft.com/demos/embed/REEVZO0Y
AttributeTypeInfo

graphid (optional)

Mixed

The id/index of the graph. The default is 0.

"mygraph" | 0 | 1 | ...

plotindex

Numeric

The index of the plot containing the rules to be returned.

0 | 1 | ...