Pallav

showing annotation through an alert

Recommended Posts

I have a realtime angular chart and am trying to enable alerts for the chart. Specifically, if the realtime value exceeds a threshold I want to show an annotation, then when the realtime value falls below the threshold I want the annotation to be hidden again.

 

 

 

Following the documentation I set up an alert and used the 'SHOWANNOTATION' action to make the annotation appear when required. Unfortunately, after the realtime value falls back below the alert's threshold the annotation does not disappear. The documentation states "When the value again falls out of alert range, FusionWidgets hides that annotation automatically." In my experience the alert correctly shows the annotation, but it's the second part where the annotation should become hidden that does not work. Does anyone have success making this work?

 

 

 

The following is a snippet from the xml that I am using:

 

 

 

 

<chart>

 

 

Share this post


Link to post
Share on other sites

Im having the same issue.  The annotations are not removed when the values fall out of the alert range.

I dont have a live link out there to send. Im running this locally.

My data.cfc guage() method just returns a string like

&CPU1=xxx&CPU2=yyy

<chart caption='Monthly Unit Sales' autoScale='1' origW='500' origH='200' lowerLimit='0' 
upperLimit='100' gaugeStartAngle='180' 
gaugeEndAngle='0' palette='1' 
numberSuffix='%' 
tickValueDistance='20' 
showValue='1' decimals='0' 
dataStreamURL='data.cfc?method=guage&id=CPU1,CPU2' 
refreshInterval='3'>
  <colorRange>
     <color minValue='0' maxValue='25' code='0000ff'/> 
  <color minValue='25' maxValue='75' code='FF654F'/>
  <color minValue='75' maxValue='90' code='F6BD0F'/>
  <color minValue='90' maxValue='100' code='8BBA00'/>
  </colorRange>
  <dials>
  <dial id='CPU2' value='43' rearExtension='10' toolText='CPU 2 Usage' valueX='50' valueY='50'/>
  </dials>

  <annotations autoScale='1' origW='270' origH='270'>
     <annotationGroup id='Grp1' visible='0'>
	 <annotation type='rectangle'  color='8BBA00' x='465' y='30' toX='495' toY='55'/>
  </annotationGroup>
  <annotationGroup id='Grp2' visible='0'>
	 <annotation type='rectangle'  color='FF654F'  x='465' y='30' toX='495' toY='55'/>
  </annotationGroup>
  </annotations>

 <alerts>
  <alert minValue='25' maxValue='75' action='showAnnotation' param='Grp2' occurOnce='0'/> 
  <alert minValue='90' maxValue='100' action='showAnnotation' param='Grp1' occurOnce='0'/> 
	    
  </alerts>
 
  <styles>
  <definition>
	 <style type='font' name='myValueFont' bgColor='F1f1f1' borderColor='999999' ></style>
  </definition>
  <application>
	 <apply toObject='Value' styles='myValueFont' />
  </application>
  </styles>

</chart>

Share this post


Link to post
Share on other sites
Guest Madhumita

Hello,

Could you please add the following code under the <alerts> tag?

 

 <alert minValue='75' maxValue='90' action='hideAnnotation' param='Grp1' occurOnce='0'/>

 <alert minValue='75' maxValue='90' action='hideAnnotation' param='Grp2' occurOnce='0'/>

 

 

 <alert minValue='0' maxValue='25' action='hideAnnotation' param='Grp1' occurOnce='0'/>

 <alert minValue='0' maxValue='25' action='hideAnnotation' param='Grp2' occurOnce='0'/>

 

Hope this helps.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now