You are viewing documentation for an older version. For current documentation - click here.

For each <annotationGroup>, you can define a unique ID as under:

<annotationGroup id='GRP1' ...>

This allows the group to be now referred using:

 
Referring in Styles
 
After specifying annotation groups, the group name can be treated as a chart object and then styles can be applied as under:
 
<chart>
      ...
         <annotations>
            <annotationGroup   id='GRP1' >
               <annotation type='rectangle' color='639ACE'   x='100' y='100' toX='200' toY='200'/>
            </annotationGroup>
           </annotations>
         <styles>
            <definition>
                 <style name='myShadow' type='shadow' distance='10' />
              </definition>
            <application>
               <apply   toObject='GRP1' styles='myShadow'/>
            </application>
           </styles>
      ...
</chart>
{
  "chart": {},
  ...
  "annotations": {
    "groups": [
      {
        "id": "GRP1",
        "items": [
          {
            "type": "rectangle",
            "color": "639ACE",
            "x": "100",
            "y": "100",
            "tox": "200",
            "toy": "200"
          }
        ]
      }
    ]
  },
  "styles": {
    "definition": [
      {
        "name": "myShadow",
        "type": "shadow",
        "distance": "10"
      }
    ],
    "application": [
      {
        "toobject": "GRP1",
        "styles": "myShadow"
      }
    ]
   ...
  }
}
 
Here, we've created an annotation group with ID as GRP1 and then applied shadow style to it.
 
Using in Alert Managers
 
If you've defined an alert manager with action as show/hide annotation, you'll need the ID of the annotation group to refer to it, as under:
 
<chart>
…
…
   <alerts>
      <alert minValue='300' maxValue='360' action='showAnnotation' param='GRP1' />
   </alerts>
</chart>
{
  "chart": {},
  ...
  "alerts": {
    "alert": [
      {
        "minvalue": "300",
        "maxvalue": "360",
        "action": "showAnnotation",
        "param": "GRP1"
      }
    ]
  }
}