Add a annotation to the bottom left of the chart

So I added an annotation to the bottom left of the chart based on pixels, but depending on the series data that loads, the chart squishes or expands - even though the height is set - and the annotation moves around.  As I do not know what the first result will be, I can't bind by column.  Is there a way to say for annotation to be in the bottom left and adjust automatically when the chart changes size?

Here is what I was doing:

var chart = new ej.charts.Chart({
width: '1020',
height: '500',
annotations: [{ // watermark for chart
content: '
XXXXX Report™
'
,
x: 120,
y: 450,
coordinateUnits: 'Pixel',
},
more options after these

3 Replies

SM Srihari Muthukaruppan Syncfusion Team May 26, 2020 09:14 AM UTC

Hi Mark, 
  
We have analyzed your query. From that, we would like to let you know that we can achieve your requirement by providing percentage value for x and y values in the annotation. Based on your requirement we have prepared a sample for your reference. Please find the below sample, code snippet, and screenshot.  
  
  
Code Snippet: 
// add your additional code here 
     
annotations: [ { 
            content: '<div id="chart_cloud"><img src="//ej2.syncfusion.com/demos/src/chart/images/sunny.png"  style="width: 41px; height: 41px"/></div>', 
            x: '5%', y: '95%', coordinateUnits: 'Pixel', verticalAlignment: 'Top' 
        }],

// add your additional code here 
  
Screenshot: 
 
  
Let us know if you have any concerns. 
  
Regards, 
Srihari M 



MA Mark May 27, 2020 03:23 AM UTC

Thank you.  This helped get me to the right direction. In short, because we first show the chart without data and then ajax load it, the annotation was moving around because the chart changes due to the legend showing underneath.  So we just dynamically change the annotation location based on the load.


SM Srihari Muthukaruppan Syncfusion Team May 27, 2020 12:47 PM UTC

Hi Mark,  
  
Most welcome. Kindly get in touch with us, if you would require further assistance. We are always happy in assisting you.   
   
Thanks,   
Srihari M 


Loader.
Up arrow icon