We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

ejChart: Annotation text content does not appear to work

See documentation here, indicating text or an id of a template may be used.

Example: http://jsplayground.syncfusion.com/andtcoqj

Error: 

ej.web.all.min.js:10 Uncaught TypeError: Cannot read property 'tagName' of undefined
    at Object.annotationRender (ej.web.all.min.js:10)
    at Object.draw (ej.web.all.min.js:10)
    at ej.web.all.min.js:10

What I'm actually after is either a template enabled (pass the series) to an annotation or a multi-level label that can reside within the header of the chart (working example: http://jsplayground.syncfusion.com/c5int2vb)

As it appears the annotations require a template, contrary to the documentation. 

Any advice?

Thank you.

Robert

3 Replies

SK Sanjith Kesavan Syncfusion Team August 31, 2017 07:37 AM UTC

HI Robert, 

Thanks for contacting Syncfusion support. We have analyzed your query and provided samples. For rendering annotation, it requires the template. Inside the content, you must mention “id” of the element which you want to display as annotation. Please find the below code example 

[html] 
<div id="TEXTTOSHOW" style="font-size:30px; display:none">TEXT TO SHOW</div> 
 
<script type="text/javascript" language="javascript"> 
$("#container").ejChart( 
//.. 
                       
//Initializing Annotation 
annotations:[ 
{visible: true, content:"watermark" }, 
{visible: true, content:"TEXTTOSHOW", region:"series", verticalAlignment: "top"} 
], 
 
//.. 
 
}); 
 
</script> 
 

Inside the content, I have passed “id” of the <div> element which I want to render as annotation. Here “region” specified whether annotation has to be placed with respect to chart or series. Please find the output in below screenshot. 
 
Find the sample from below link 
Sample: annotation 

To know more details about annotation, please follow the below link 

Please let us know if you have any concern. 

Regards, 
Sanjith. 



RM Robert Mims August 31, 2017 11:12 AM UTC

Sanjit,

Thank you - and the documentation now reflects the same. 

Kind regards.

Robert



SK Saravana Kumar Kanagavel Syncfusion Team September 1, 2017 10:03 AM UTC

  
Hi Robert, 
 
Thanks for your update. 
 
Please let us know if you need any other information on this. 
 
Regards, 
Saravana Kumar K. 
  


Loader.
Live Chat Icon For mobile
Up arrow icon