Alert Manager |
Alert Manager helps you define your own thresholds for data values and then perform specific actions for each defined threshold. For example, if you’re plotting a real-time temperature chart and you wish to play a sound when the temperature reaches between say 90 and 100 Fahrenheit, you can easily do so using Alert Manager. Alert Manager allows you to define any number of alert threshold ranges for the chart. The threshold range just shouldn't overlap. For each threshold range, you can specify one of the following actions:
To aid your understanding of this section, we recommend you to go through the Alert Manager section. |
Setting up alert manager |
For any real-time chart, you can set up the alert manager as under: |
<chart> … … <alerts> <alert minValue='240' maxValue='300' action='callJS' param="alert('Value between 240 and 300');" /> <alert minValue='300' maxValue='360' action='showAnnotation' param='statusRed' occurOnce='0'/> <alert minValue='360' maxValue='400' action='playsound' param='YourSound.mp3'/> </alerts> </chart> { "chart": {}, ... "alerts": { "alert": [ { "minvalue": "240", "maxvalue": "300", "action": "callJS", "param": "alert('Value between 240 and 300');" }, { "minvalue": "300", "maxvalue": "360", "action": "showAnnotation", "param": "statusRed", "occuronce": "0" }, { "minvalue": "360", "maxvalue": "400", "action": "playsound", "param": "YourSound.mp3" } ] } } |
The container element for alerts is <alerts>, which is a child of the <chart> element. This element cannot have any attribute. Now, for each alert range, you need to define an <alert> element as a child of the <alerts> element. The <alert> element can have the following attributes:
|
Setting alert manager control for individual datasets |
In data streaming charts, you can additionally control the datasets that are checked by alert manager to raise any events. For example, if you're comparing the stock price of Google and Dell on a single real-time line chart but want alerts to be defined and raised only for Google, you can disable the alert for Dell's dataset using: |
The checkForAlerts attribute when set to 0 eliminates a dataset's value from being checked for alerts. By default, if alerts are defined, all datasets are checked for alerts. |