Notes

Overview

The note api allows you to dynamically add, update and remove chart annotations.

Note: Requires the zingchart-api-annotations.min.js module.

addnote

Adds a note to a chart.

zingchart.exec('zc', 'addnote', {
    id: 'note1',
    type: 'node',
    text: 'Note 1',
    plotindex: 0,
    nodeindex: 3
});
AttributeTypeInfo
graphid (optional)Mixed

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

"mygraph" | 0 | 1 | ...

idString

The id of the note to be added.

"note1" | "note2"

textString

The text to be included in the note.

"Note 1" | "%v widgets"

typeString

The type of note to be added.

"node" | "scale" | "xy"

styleObject

Styling attributes to be applied to the note.

{ ... }

plotindexNumeric

The index of the plot to which the note will be added.

0 | 1 | ...

nodeindexNumeric

The index of the node to which the note will be added.

0 | 1 | ...

scaleindexNumeric

The index of the scale to which the note will be added.

0 | 1 | ...

scalevalueMixed

The value of the scale item to which the note will be added.

"Friday" | 1 | 2 | ...

xNumeric

The x position.

5 | 10 | ...

yNumeric

The y position.

5 | 10 | ...

offset-xNumeric

An offset in the x direction to be applied to the note.

5 | -10 | ...

offset-yNumeric

An offset in the y direction to be applied to the note.

0 | 1 | ...

removenote

Removes a note from a chart.

zingchart.exec('zc', 'removenote', { 
  id: [ 'note1', 'note2', 'note3' ] 
});
https://app.zingsoft.com/demos/embed/F3CSNRBU
https://app.zingsoft.com/demos/embed/F3CSNRBU
AttributeTypeInfo
graphid (optional)Mixed

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

"mygraph" | 0 | 1 | ...

idMixed

The id of the note or notes to be removed.

"rule1" | ["rule1,"rule2"]

updatenote

Updates an existing note.

zingchart.exec('zc', 'updatenote', { 
  id: 'note1', 
  style: { 
    'border-color': '\#090', 
    'border-width': 5 
  }, 
  type: 'node', 
  plotindex: 1, 
  nodeindex: 1, 
  text: 'Note 1 (revision 1)' 
});
https://app.zingsoft.com/demos/embed/F3CSNRBU
https://app.zingsoft.com/demos/embed/F3CSNRBU
AttributeTypeInfo
graphid (optional)Mixed

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

"mygraph" | 0 | 1 | ...

idString

The id of the note to be updated.

"note1" | "note2"

textString

The text to be included in the note.

"Note 1" | "%v widgets"

typeString

The type of note to be updated.

"node" | "scale" | "xy"

styleObject

Styling attributes to be applied to the note.

{ ... }

plotindexNumeric

The index of the plot to update the note to.

0 | 1 | ...

nodeindexNumeric

The index of the node to update the note to.

0 | 1 | ...

scaleindexNumeric

The index of the scale to update the note to.

0 | 1 | ...

scalevalueMixed

The value of the scale item to update the note to.

"Friday" | 1 | 2 | ...

xNumeric

The x position.

5 | 10 | ...

yNumeric

The y position.

5 | 10 | ...

offset-xNumeric

An offset in the x direction to be applied to the note.

5 | -10 | ...

offset-yNumeric

An offset in the y direction to be applied to the note.

0 | 1 | ...