setAnnotationValue Parameter Syntax - CircularGauge

Good Evening

I am struggling to understand the parameter syntax for setAnnotationValue for the CircularGauge control.

The API documentation here shows no details on the parameters https://ej2.syncfusion.com/javascript/documentation/api/circular-gauge/

while this post gives some clues showing that the third parameter seems to  be the html markup for the annotation text https://www.syncfusion.com/forums/148057/display-text-above-the-pointer

I used this example as a guide https://ej2.syncfusion.com/javascript/demos/#/material/circular-gauge/customization.html and tried using the content html markup as the third parameter to the setAnnotationValue call but unfortunately it doesnt work in the console in chrome I get an error saying "Cannot set property 'content' of undefined' perhaps I am missing something as I would appreciate assistance as this is the last thing I need to fix

Thanks

1 Reply 1 reply marked as answer

SB Swetha Babu Syncfusion Team November 16, 2020 11:21 AM UTC

Hi Peter,

Thank you for contacting Syncfusion support. 
  
We are not able to reproduce the reported issue. We can update the existing annotation using setAnnotationValue() method of the Circular gauge control. We need to initialize the annotation initially when the control is initialized. The setAnnotationValue method takes 3 parameters. Index of the axis,  index of the annotation and the content to be added as annotation. The content can be a text or a HTML string. We have created a simple sample to demonstrate the same. Please find the sample from the below link for your reference.

https://stackblitz.com/edit/nnmxss-shussz?file=index.ts

In the above sample, we have created a circular gauge with ranges and one button. An annotation is rendered with empty content initially. When we click the “Add annotation” button, the empty content of the annotation is modified to “Speedometer” text provided with the help of setAnnotationValue method.

Please let us know if you need any further assistance.

Regards,
Swetha Babu 


Marked as answer
Loader.
Up arrow icon