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

<annotationGroup id='GRP1' ...>

This allows the group to be now referred using:

  • STYLEs
  • Alert Manager
  • JavaScript API
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>
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>