Marker on last point of chart line

I want to dynamically find the absolute location on the screen for the last point of a series. Is it possible?

Thanks!

3 Replies

SM Srihari Muthukaruppan Syncfusion Team June 4, 2020 11:30 AM UTC

Hi Renato, 
  
We have analyzed your query. From that, we suggest you to use the below methods to achieve your requirement, 
  
Method #1: 
  
We have analyzed your query. Based on your requirement we have prepared a sample for your reference. In which we have displayed the absolute location on the screen for the last point of a series 0 on the button click. Please find the below code snippet and sample.  
  
  
Code Snippet: 
  
<div class="col-md-3">         
    <input type="button" id="loadPoints" value="Location" onclick="loadPoints()"/>       
 </div>   
function loadPoints() 
{ 
      var chart = $("#container").ejChart("instance"); 
      var length = chart.model.series[0].points.length - 1; 
      console.log(chart.model.series[0].points[length].location);          
 } 
  
  
Screenshot: 
 
  
Method #2: 
  
We can also achieve your requirement by using the pointRegionMouseMove event in the chart. Based on your requirement we have also prepared a sample for reference. Please find below the code snippet and sample.  
  
  
Code Snippet: 
  
$("#container").ejChart( 
        { 
            pointRegionMouseMove: function (args) { 
                  console.log(args.data.location); 
             },      
       // add your additional code here 
         } 
  
Screenshot: 
 
  
Let us know if you have any concerns. 
  
Regards, 
Srihari M 



RE Renato June 4, 2020 03:58 PM UTC

Method 2 worked for me with the 'displayTextRendering' event. Thank you!


SM Srihari Muthukaruppan Syncfusion Team June 5, 2020 04:58 AM UTC

Hi Renato,  
  
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