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
close icon

Add label to datapoint

Hello,
in Xamarin.Android I have FastLineSerie where I plot real time data from sensor.

I want to add a label to 5th datapoint of the serie.

Then some new data are added to the serie as they arrived from the sensor. The label must remain at the 5th datapoint.

Then after some time I want to remove the label.

Thanks for the advice.

9 Replies

MD Martin Dusek January 12, 2017 10:13 PM UTC

Sorry, this is exactly what I want:

I want to add a label to 5th datapoint of the serie.

Then some new data are added to the serie as they arrived from the sensor. The label must remain at the 5th datapoint.

Then after some time I want to remove the label.

Then after some time I want to add a label to 6th datapoint of the serie.


SP Saravana Pandian Murugan Syncfusion Team January 13, 2017 03:28 PM UTC

Hi Martin,

Thanks for contacting Syncfusion support.

We have prepared a sample based on your requirement using DataMarkerLabelCreated event which can be downloaded from the below location.

Sample : http://www.syncfusion.com/downloads/support/forum/128302/ze/DataMarkerSample-616955935  

Please check and let us know if you need further assistance.

Thanks,
Saravana Pandian M.
 



MD Martin Dusek January 16, 2017 08:08 PM UTC

Hello,
thanks. Is it possible to optimize this? In my case, I plot up to 20 series, each with 180 datapoints. With this setup, my GUI becomes unresponsive when the chart has labels enabled.

If it is not possible to optimize it: Is it possible to get x and y coordinates of datapoint relative to chart coordinate system? I would then be able to draw my own graphics on top of the chart (I would display label at last datapoint coordinates which should be fast).

Best regards

Martin


YP Yuvaraj Palanisamy Syncfusion Team January 17, 2017 02:53 PM UTC

Hi Martin,

We are not able to reproduce the issue and we have modified the sample as per your requirement. Please update us the modified sample to reproduce the issue which will be helpful for providing further assistance on this.

Sample: http://www.syncfusion.com/downloads/support/forum/128302/ze/DataMarkerSample-1815646281  

Regards,
Yuvaraj 



MD Martin Dusek January 17, 2017 06:25 PM UTC

What device do you try this sample on?

On WinMate M700DM8 and on LG G3 I get hardly one iteration of while loop in UpdateData method per 3 seconds (it should iterate roughly once per second). Both devices are obviously very busy redrawing labels in chart.

If I reduce number of series from 20 to 5, then both devices are able to iterate while loop in UpdateData method roughly once per second.

Or is there any optimization I have to turn on in my devices?


MK Magesh Kumar Krishnan Syncfusion Team January 18, 2017 02:25 PM UTC

Hi Martin, 
  
We can achieve your requirement by using ValueToPoint method of ChartAxis. We have prepared sample based in this. Please download the sample from location given below. 
  
  
Regards, 
Magesh 



MD Martin Dusek January 18, 2017 06:08 PM UTC

Hello,
thanks but unfortunately, I can't compile the project.

On line 303 there is error:

Error CS7036 There is no argument given that corresponds to the required formal parameter 'javaReference' of 'FastLineSegment.FastLineSegment(IntPtr, JniHandleOwnership)' DataMarkerSample C:\DataMarkerSample264781638\DataMarkerSample\MainActivity.cs 303 Active

I use 14.4.0.20 Syncfusion.Xamarin.SfChart.Android nuget package.


MD Martin Dusek January 18, 2017 09:41 PM UTC

Dear Magesh,
thank you very much. That's exactly what I need!

Best regards

Martin


SP Saravana Pandian Murugan Syncfusion Team January 19, 2017 06:49 AM UTC

Hi Martin,

Thanks for using Syncfusion products.

We have created a new incident under your Direct Trac account. We suggest you to follow up the incident for further reference using your direct trac account. 

DirectTrack Account Login : https://www.syncfusion.com/account/login   

Please let us know if you have any concerns.

Regards,
Saravana Pandian M.

Loader.
Live Chat Icon For mobile
Up arrow icon