addAnnotation() Method
Description
Adds new annotation to the chart.
This function can be called only onChartDraw event has been fired, if you call addAnnotation prior to that - no annotation is added.
Parameters
- config: Object or XML String
Annotation config, which defines the type of annotation and other settings. It can be both in XML and JSON format.
See <annotation> element in XML Reference or annotation object in JSON Reference.
Note: When you use XML, type and chart attributes are required. When you use JSON type and chart properties are required.
Returns
Boolean.
Note: If "true" - annotation is added successfully, in the opposite case - "false" is returned.
Samples
Add annotation using JSON:
Add annotation using XML:
Sample:
Online HTML/JavaScript Sample