Notes

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

Note: Requires the zingchart-api-annotations.min.jsmodule.

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

id

String

The id of the note to be added.

"note1" | "note2"

text

String

The text to be included in the note.

"Note 1" | "%v widgets"

type

String

The type of note to be added.

"node" | "scale" | "xy"

style

Object

Styling attributes to be applied to the note.

{ ... }

plotindex

Numeric

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

0 | 1 | ...

nodeindex

Numeric

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

0 | 1 | ...

scaleindex

Numeric

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

0 | 1 | ...

scalevalue

Mixed

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

"Friday" | 1 | 2 | ...

x

Numeric

The x position.

5 | 10 | ...

y

Numeric

The y position.

5 | 10 | ...

offset-x

Numeric

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

5 | -10 | ...

offset-y

Numeric

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']
});
        
A ZingChart Embedded Demohttps://app.zingsoft.com/demos/embed/F3CSNRBU
AttributeTypeInfo

graphid (optional)

Mixed

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

"mygraph" | 0 | 1 | ...

id

Mixed

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)'
});
        
A ZingChart Embedded Demohttps://app.zingsoft.com/demos/embed/F3CSNRBU
AttributeTypeInfo

graphid (optional)

Mixed

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

"mygraph" | 0 | 1 | ...

id

String

The id of the note to be updated.

"note1" | "note2"

text

String

The text to be included in the note.

"Note 1" | "%v widgets"

type

String

The type of note to be updated.

"node" | "scale" | "xy"

style

Object

Styling attributes to be applied to the note.

{ ... }

plotindex

Numeric

The index of the plot to update the note to.

0 | 1 | ...

nodeindex

Numeric

The index of the node to update the note to.

0 | 1 | ...

scaleindex

Numeric

The index of the scale to update the note to.

0 | 1 | ...

scalevalue

Mixed

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

"Friday" | 1 | 2 | ...

x

Numeric

The x position.

5 | 10 | ...

y

Numeric

The y position.

5 | 10 | ...

offset-x

Numeric

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

5 | -10 | ...

offset-y

Numeric

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

0 | 1 | ...