Data Manipulation

Data Manipulation

addnode

Adds a node to an existing plot.

zingchart.exec('myid', 'addnode', {
    graphid: 0,
    plotindex: 1,
    nodeindex: 2,
    value: 37
});
AttributeTypeInfo
graphid (optional)Mixed

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

"mygraph" | 0 | 1 | ...

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

plotidString

The id of the plot to add data to.

"mylineplot" | ...

plotindexNumeric

The index of the plot to add data to.

0 | 1 | ...

updateBoolean

Sets (default true) if the data manipulation API is instantly applied or "queued" in a list of consecutive API calls. Require the call of update API in order for all the queued changes to take effect.

true | false | 1 | 0

valueNumeric

The value to add to the plot.

45 | 0.27 | ...

addplot

Adds a new plot.

zingchart.exec('myid', 'addplot', { 
  graphid: 0, 
  plotindex: 1, 
  data: { 
    values: [10, 20, 15, ...], 
    text: "My new plot" 
  } 
});
https://app.zingsoft.com/demos/embed/NCTSH20Q
https://app.zingsoft.com/demos/embed/NCTSH20Q
AttributeTypeInfo
data/plotdataObject

The JSON data that would be set in the series section of the JSON for the individual plot.

{...}

graphid (optional)Mixed

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

"mygraph" | 0 | 1 | ...

plotidString

The id of an existing plot after which the new plot will be inserted. If it is not set, it is placed at the end.

"mylineplot" | ...

plotindexNumeric

The index of the plot to be inserted. If it is not set, it is placed at the end.

0 | 1 | ...

updateBoolean

Sets (default true) if the data manipulation API is instantly applied or "queued" in a list of consecutive API calls. Require the call of update API in order for all the queued changes to take effect.

true | false | 1 | 0

appendseriesdata

Appends data to the existing series. Can be used on a single plot or the whole series.

Note: that the value arrays sent do not concatenate the existing ones.

zingchart.exec('myid', 'appendseriesdata', { 
  graphid: 0, 
  plotindex: 1, 
  data: { lineColor: "red" } 
});
zingchart.exec('myid', 'appendseriesdata', { 
  graphid: 0, 
  data: [
    { lineColor: "red" }, 
    { lineColor: "yellow" } 
  ] 
});
https://app.zingsoft.com/demos/embed/NWL6MBV0
https://app.zingsoft.com/demos/embed/NWL6MBV0
AttributeTypeInfo
dataMixed

The JSON data that would be set in the series section of the JSON for the individual plot. If setting multiple plots, data should be in an array.

{...} | [ {...}, {...}, ... ]

graphid (optional)Mixed

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

"mygraph" | 0 | 1 | ...

plotidString

The id of the plot if only appending the data on a single plot.

"mylineplot" | ...

plotindexNumeric

The index of the plot if only appending the data on a single plot.

0 | 1 | ...

updateBoolean

Sets (default true) if the data manipulation API is instantly applied or "queued" in a list of consecutive API calls. Require the call of update API in order for all the queued changes to take effect.

true | false | 1 | 0

appendseriesvalues

Appends data to the end of a plot. Can be used on a single plot or the whole series.

zingchart.exec('myid', 'appendseriesvalues', { 
  plotindex: 1, 
  values: [19, 28, 13, 42, ...] 
});
https://app.zingsoft.com/demos/embed/GLEAXRO3
https://app.zingsoft.com/demos/embed/GLEAXRO3
AttributeTypeInfo
graphid (optional)Mixed

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

"mygraph" | 0 | 1 | ...

plotidString

The id of an existing plot after which the new plot will be inserted. If it is not set, it is placed at the end.

"mylineplot" | ...

plotindexNumeric

The index of the plot if only appending the data on a single plot.

0 | 1 | ...

updateBoolean

Sets (default true) if the data manipulation API is instantly applied or "queued" in a list of consecutive API calls. Require the call of update API in order for all the queued changes to take effect.

true | false | 1 | 0

valuesArray

An array of values to append. If plotindex is not specified, the data should be an array of arrays.

[...] | [ [...], [...], ... ]

getseriesdata

Returns the series data as an object. If plot is specified via plotindex or plotid then only that series item data is returned.

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

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

"mygraph" | 0 | 1 | ...

plotidString

The id of the plot if only setting the data on a single plot.

"mylineplot" | ...

plotindexNumeric

The index of the plot if only setting the data on a single plot.

0 | 1 | ...

getseriesvalues

Returns the series values in an array or an array of arrays. If plot is specified via plotindex or plotid then only that series item values are returned.

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

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

"mygraph" | 0 | 1 | ...

plotidString

The id of the plot if only setting the data on a single plot.

"mylineplot" | ...

plotindexNumeric

The index of the plot if only setting the data on a single plot.

0 | 1 | ...

modifyplot

Modifies an existing plot.

zingchart.exec('myid', 'modifyplot', { 
  graphid: 0, 
  plotindex: 1, 
  data: { 
    lineWidth: 2, 
    lineColor: "yellow" 
  } 
});
https://app.zingsoft.com/demos/embed/ROPRBW9R
https://app.zingsoft.com/demos/embed/ROPRBW9R
AttributeTypeInfo
data/plotdataObject

The JSON string that would be appended in the series section of the JSON for the individual plot.

{...}

graphid (optional)Mixed

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

"mygraph" | 0 | 1 | ...

plotidString

The id of an existing plot after which the new plot will be inserted. If it is not set, it is placed at the end.

"mylineplot" | ...

plotindexNumeric

The index of the plot to be inserted. If it is not set, it is placed at the end.

0 | 1 | ...

updateBoolean

Sets (default true) if the data manipulation API is instantly applied or "queued" in a list of consecutive API calls. Require the call of update API in order for all the queued changes to take effect.

true | false | 1 | 0

removenode

Removes a node.

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

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

"mygraph" | 0 | 1 | ...

nodeindexNumeric

The index of the node to be removed. The values will be shifted.

0 | 8 | 20 | ...

plotidString

The id of the plot to remove the data from.

"mylineplot" | ...

plotindexNumeric

The index of the plot to remove the data from.

0 | 1 | ...

updateBoolean

Sets (default true) if the data manipulation API is instantly applied or "queued" in a list of consecutive API calls. Require the call of update API in order for all the queued changes to take effect.

true | false | 1 | 0

removeplot

Removes a plot.

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

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

"mygraph" | 0 | 1 | ...

plotidString

The id of the plot to be removed.

"mylineplot" | ...

plotindexNumeric

The index of the plot to be removed.

0 | 1 | ...

updateBoolean

Sets (default true) if the data manipulation API is instantly applied or "queued" in a list of consecutive API calls. Require the call of update API in order for all the queued changes to take effect.

true | false | 1 | 0

set3dview

Sets the new 3D parameters for the view, overrides the settings from 3d-aspect attribute of the chart.

zingchart.exec('myid', 'set3dview', {
    'y-angle': 10,
    depth: 60
});
https://app.zingsoft.com/demos/embed/IT6G7RC3
https://app.zingsoft.com/demos/embed/IT6G7RC3
AttributeTypeInfo
graphidMixed

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

"mygraph" | 0 | 1 | ...

x-angle
xAngle
Numeric

Sets the X rotation viewing angle for the true 3D view. Viewing angle may vary depending on the chart type.

0 | 8 | 20 | ...

y-angle
yAngle
Numeric

Sets the Y rotation viewing angle for the true 3D view. Viewing angle may vary depending on the chart type.

"mygraph" | 0 | 1 | ...

z-angle
zAngle
Numeric

Sets the Z rotation viewing angle for the true 3D view. Viewing angle may vary depending on the chart type.

5| 10| ...

depthNumeric

Sets the Z depth for a 3D chart type displayed in either isometric or true 3D.

5 | 10 | ...

setnodevalue

Changes the value on a single node.

zingchart.exec('myid', 'setnodevalue', {
    graphid: 0,
    plotindex: 1,
    nodeindex: 2,
    value: 80
});
https://app.zingsoft.com/demos/embed/212EKSWS
https://app.zingsoft.com/demos/embed/212EKSWS
AttributeTypeInfo
graphid (optional)Mixed

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

"mygraph" | 0 | 1 | ...

nodeindexNumeric

The index of the node to replace.

0 | 8 | 20 | ...

plotidString

The id of the plot.

"mylineplot" | ...

plotindexNumeric

The index of the plot.

0 | 1 | ...

updateBoolean

Sets (default true) if the data manipulation API is instantly applied or "queued" in a list of consecutive API calls. Require the call of update API in order for all the queued changes to take effect.

true | false | 1 | 0

setseriesdata

Replaces the series data. Can be used on a single plot or the whole series.

zingchart.exec('myid', 'setseriesdata', {
    graphid: 0,
    plotindex: 1,
    data: {
        values: [10, 15, 20, ...],
        lineColor: "red"
    }
});
zingchart.exec('myid', 'setseriesdata', {
    graphid: 0,
    data: [
        {
            values: [10, 15, 20, ...],
            lineColor: "red"
        },
        {
            values: [40, 25, 30, ...],
            lineColor: "yellow"
        }
    ]
});
https://app.zingsoft.com/demos/embed/0U1SN1IS
https://app.zingsoft.com/demos/embed/0U1SN1IS
AttributeTypeInfo
dataMixed

The JSON data that would be set in the series section of the JSON for the individual plot. If setting multiple plots, data should be in an array.

{...} | [ {...}, {...}, ... ]

graphid (optional)Mixed

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

"mygraph" | 0 | 1 | ...

plotidString

The id of the plot if only setting the data on a single plot.

"mylineplot" | ...

plotindexNumeric

The index of the plot if only setting the data on a single plot.

0 | 1 | ...

updateBoolean

Sets (default true) if the data manipulation API is instantly applied or "queued" in a list of consecutive API calls. Require the call of update API in order for all the queued changes to take effect.

true | false | 1 | 0

setseriesvalues

Replaces the series values. Can be used on a single plot or the whole series.

zingchart.exec('myid', 'setseriesvalues', { 
  values: [ [19, 28, 13, 42, ...], [37, 11, 27, 25, ...] ] 
});
zingchart.exec('myid', 'setseriesvalues', { 
  plotindex: 1, 
  values: [19, 28, 13, 42, ...] 
});
https://app.zingsoft.com/demos/embed/1YB4YK9U
https://app.zingsoft.com/demos/embed/1YB4YK9U
AttributeTypeInfo
graphid (optional)Mixed

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

"mygraph" | 0 | 1 | ...

plotidString

The id of the plot if only setting the data on a single plot.

"mylineplot" | ...

plotindexNumeric

The index of the plot if only setting the data on a single plot.

0 | 1 | ...

updateBoolean

Sets (default true) if the data manipulation API is instantly applied or "queued" in a list of consecutive API calls. Require the call of update API in order for all the queued changes to take effect.

true | false | 1 | 0

valuesArray

An array of values. If plotindex is not specified, the data should be an array of arrays.

[...] | [ [...], [...], ... ]