Namespace: annotations

FusionCharts~ annotations

Annotations let you create your own custom objects within charts. One can create various shapes like polygons, rectangles, circles, arcs, etc., render annotation text at required positions, load external images and much more.

Members

<static> this.groups :FusionCharts~annotations~Groups[]

The list of all the groups that have been rendered using the given instance of the annotations class.

Type:

FusionCharts~annotations~Groups[]

Methods

addGroup(options) → {object}

Adds a group in the annotations that acts as a container for the shapes that have to be drawn within the group. The shapes drawn within a group generally share some properties or characteristics.

Parameters:
Parameter Description
options
Type:
object

The options that pertain to the new group element to be added.

Returns:

newGroup The created group object.

Type:

object

addItem(groupId, options)

Adds an item to either a specific group or creates a new group and adds the item to it.

Parameters:
Parameter Description
groupId
Type:
string
Attributes:
<optional>

If the item has to be added to a particular group then, the id of that group is required.

options
Type:
object

The options that have to used to create the item.

clear()

Clears all groups and the contained shapes that belong to the annotation object.

hide(id)

Hides the item (group or shape) with the given id.

Parameters:
Parameter Description
id
Type:
string

show(id)

Shows the item (group or shape) with the given id.

Parameters:
Parameter Description
id
Type:
string

update(id, key, value)

Method to dynamically update a shape or group with an id.

Parameters:
Parameter Description
id
Type:
string

The id of the annotation shape or group.

key
Type:
string or object

The option that is to be updated.

value
Type:
string

The new value to be assigned to the option.

destroy(id)

Destros a particular item (group or shape) with the given id.

Parameters:
Parameter Description
id
Type:
string

Events

annotationClick

Fired when an annotation is clicked

Parameters:
Parameter Description
chartX
Type:
number

x-coordinate of the pointer relative to the chart.

chartY
Type:
number

y-coordinate of the pointer relative to the chart.

pageX
Type:
number

x-coordinate of the pointer relative to the page.

pageY
Type:
number

y-coordinate of the pointer relative to the page.

annotationId
Type:
string

Specifies the Id of the annotation (if provided during annotation creation).

annotationOptions
Type:
object

contains all the options that are set on the annotations.

groupId
Type:
string

Specifies the Id of the annotation group (if provided during annotation creation) within which the annotation exists.

groupOptions
Type:
object

contains all the options that are set on the annotation group.

annotationRollOver

Fired when the pointer moves over an annotation

Parameters:
Parameter Description
chartX
Type:
number

x-coordinate of the pointer relative to the chart.

chartY
Type:
number

y-coordinate of the pointer relative to the chart.

pageX
Type:
number

x-coordinate of the pointer relative to the page.

pageY
Type:
number

y-coordinate of the pointer relative to the page.

annotationId
Type:
string

Specifies the Id of the annotation (if provided during annotation creation).

annotationOptions
Type:
object

contains all the options that are set on the annotations.

groupId
Type:
string

Specifies the Id of the annotation group (if provided during annotation creation) within which the annotation exists.

groupOptions
Type:
object

contains all the options that are set on the annotation group.

annotationRollOut

Fired when the pointer moves out of an annotation

Parameters:
Parameter Description
chartX
Type:
number

x-coordinate of the pointer relative to the chart.

chartY
Type:
number

y-coordinate of the pointer relative to the chart.

pageX
Type:
number

x-coordinate of the pointer relative to the page.

pageY
Type:
number

y-coordinate of the pointer relative to the page.

annotationId
Type:
string

Specifies the Id of the annotation (if provided during annotation creation).

annotationOptions
Type:
object

contains all the options that are set on the annotations.

groupId
Type:
string

Specifies the Id of the annotation group (if provided during annotation creation) within which the annotation exists.

groupOptions
Type:
object

contains all the options that are set on the annotation group.