Graph Information

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');
https://app.zingsoft.com/demos/embed/ANYULDY8
https://app.zingsoft.com/demos/embed/ANYULDY8

getgraphlength

Returns the number of graphs in the chart.

zingchart.exec('myid', 'getgraphlength');
https://app.zingsoft.com/demos/embed/BNKAM9JP
https://app.zingsoft.com/demos/embed/BNKAM9JP

getnodelength

Returns the number of nodes in a given plot.

zingchart.exec('myid', 'getnodelength', { 
  graphid: 0, 
  plotindex: 2 
});
https://app.zingsoft.com/demos/embed/A5X1OHIF
https://app.zingsoft.com/demos/embed/A5X1OHIF
AttributeTypeInfo
graphid (optional)Mixed

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

"mygraph" | 0 | 1 | ...

plotindexNumeric

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 
});
https://app.zingsoft.com/demos/embed/HWB7MX29
https://app.zingsoft.com/demos/embed/HWB7MX29
AttributeTypeInfo
graphid (optional)Mixed

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

"mygraph" | 0 | 1 | ...

nodeindexNumeric

The index in the specified plot of the node.

0 | 8 | 20 | ...

plotindexNumeric

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'
});
https://app.zingsoft.com/demos/embed/I2QLSC3R
https://app.zingsoft.com/demos/embed/I2QLSC3R
AttributeTypeInfo
graphid (optional)Mixed

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

"mygraph" | 0 | 1 | ...

nameString

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

"scale-x" | "..."

nodeindexNumeric

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 | ...

objectString"graph" | "plotarea" | "scale" | "plot" | "node"
plotidString

The id of the plot to add data to.

"mylineplot" | ...

plotindexNumeric

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
});
https://app.zingsoft.com/demos/embed/U8KC1IKE
https://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
});
https://app.zingsoft.com/demos/embed/92VX2DTO
https://app.zingsoft.com/demos/embed/92VX2DTO
AttributeTypeInfo
graphid (optional)Mixed

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

"mygraph" | 0 | 1 | ...

plotindexNumeric

The index of the plot.

0 | 1 | ...

getrender

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

zingchart.exec('myid', 'getrender');
https://app.zingsoft.com/demos/embed/6FBLYC02
https://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
});
https://app.zingsoft.com/demos/embed/DGNYHJNB
https://app.zingsoft.com/demos/embed/DGNYHJNB
AttributeTypeInfo
graphid (optional)Mixed

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

"mygraph" | 0 | 1 | ...

plotindexNumeric

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');
https://app.zingsoft.com/demos/embed/SINOBCJI
https://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');
https://app.zingsoft.com/demos/embed/F4E921OY
https://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
});
https://app.zingsoft.com/demos/embed/LU2LXDGC
https://app.zingsoft.com/demos/embed/LU2LXDGC
AttributeTypeInfo
xNumeric

The x position.

5 | 10 | ...

yNumeric

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
});
https://app.zingsoft.com/demos/embed/REEVZO0Y
https://app.zingsoft.com/demos/embed/REEVZO0Y
AttributeTypeInfo
graphid (optional)Mixed

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

"mygraph" | 0 | 1 | ...

plotindexNumeric

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

0 | 1 | ...