Chart with a LineSeries ended in a circle / big point

Hello Syncfusion Support!

How could I create a chart with a LineSeries which ended in a circle / big point?

I didn't find an example of that, even in forum.

Thank you very much!

Regards.

9 Replies 1 reply marked as answer

YP Yuvaraj Palanisamy Syncfusion Team March 23, 2021 10:27 AM UTC

Hi Lolo Rodri, 
 
Greetings from Syncfusion

WE have achieved your requirement “Line series ended with circle” with the help of adding additional series (Scatter series with Last datapoint of Line series). And you can adjust the size of the circle with the help of ScatterWidth & ScatterHeight property of ScatterSeries. Please find the code example below. 

CodeSnippet
<chart:SfChart.Series> 
    <chart:LineSeries ItemsSource="{Binding Data}"  
                      XBindingPath="XValue"  
                      YBindingPath="YValue"/> 

    <chart:ScatterSeries ItemsSource="{Binding ScatterData}" 
                         ScatterHeight="20"  
                         ScatterWidth="20"  
                         Opacity="1" 
                         Color="Blue" 
                         XBindingPath="XValue"  
                         YBindingPath="YValue"/> 
</chart:SfChart.Series> 

Also, we have prepared the sample for your reference, please find the sample from the below link. 
 
  
Output: 
 
 
Regards, 
Yuvaraj. 


Marked as answer

LR Lolo Rodri March 24, 2021 10:56 AM UTC

Firstly, thanks for the solution. It's so useful!
But it seems the solution isn'tworking on my project. 
The only difference I can notice is that my X axis is a CategoryAxis with String values on XBindingPath, no NumericalAxis and no numerical values.

Could you show me if it works on CategoryAxis too? I don't know if it is not able to work for that kind of Axis.
In case it could, maybe is a problem of assigning string values for X in CategoryAxis with ScatterSeries?
Thanks in advance.

Regards.
Lolo.


YP Yuvaraj Palanisamy Syncfusion Team March 25, 2021 07:32 AM UTC

Hi Lolo Rodri, 
  
We would like to inform you that the requirement with CategoryAxis has been achieved by setting of ArrangeByIndex property to False. Please find the code example below. 
  
CodeSnippet: 
<chart:SfChart.PrimaryAxis> 
    <chart:CategoryAxis ArrangeByIndex="False"  
                        PlotOffsetEnd="30"/> 
</chart:SfChart.PrimaryAxis> 
  
Also, we have attached the sample for your reference, please find the sample from the below link. 
 
Sample: 
  
Output: 
 
  
For more details, please refer the below link. 
  
  
  
Regards, 
Yuvaraj 



LR Lolo Rodri August 19, 2021 01:58 PM UTC

Hello Yuvaraj,
Many months pass and I realizenow  that there is no any sample in your last answer. Could you please reattach it? Thanks in advance



YP Yuvaraj Palanisamy Syncfusion Team August 20, 2021 04:55 PM UTC

Hi Lolo Rodri, 
 
Sorry for the inconvenience. 
 
We have prepared the sample as per your requirement “Category axis with Circle at end datapoint” with the help of ArrangeByIndex property of CategoryAxis. Please fine the sample from the below link 
 
 
Output: 
 
 
Please let us know if you have any concern. 
 
Regards, 
Yuvaraj.


LR Lolo Rodri August 23, 2021 08:46 AM UTC

Good morning Yuvaraj,


I tried to set that property , "ArrangeByIndex", with False but one error occurs.

I am using on behind code the method OnSizeAllocated (Inherited from Page) and when I set ArrangeByIndex with False and run app it throws an exception (I leave you a screenshot of exception below).

Is it mean that I cannot use ScatterSeries with a CategoryAxis to make a end circle in chart if I am using OnSizeAllocated on behind code?


Exception details:

Document
ValueType
$exception{System.ArgumentNullException: Value cannot be null. Parameter name: source at System.Linq.Enumerable.Select[TSource,TResult] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] selector) [0x00003] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/external/corefx/src/System.Linq/src/System/Linq/Select.cs:18 at Com.Syncfusion.Charts.CategoryAxis.GroupData (System.Collections.ObjectModel.ObservableCollection`1[T] visibleSeries) [0x00070] in :0 at Com.Syncfusion.Charts.ChartBase.UpdateArea () [0x000bb] in :0 at Com.Syncfusion.Charts.ChartBase.OnMeasureChart () [0x00031] in :0 at Com.Syncfusion.Charts.SfChart.OnMeasure (System.Int32 widthMeasureSpec, System.Int32 heightMeasureSpec) [0x00260] in :0 at Android.Views.View.n_OnMeasure_II (System.IntPtr jnienv, System.IntPtr native__this, System.Int32 widthMeasureSpec, System.Int32 heightMeasureSpec) [0x00008] in /Users/builder/azdo/_work/278/s/xamarin-android/src/Mono.Android/obj/Release/monoandroid10/android-29/mcw/Android.Views.View.cs:17648 at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.25(intptr,intptr,int,int)}System.ArgumentNullException


YP Yuvaraj Palanisamy Syncfusion Team August 24, 2021 04:40 PM UTC

Hi Lolo Rodri, 
 
We have analyzed your query and stack trace, we are trying to reproduce the reported problem “Throws exception when setting ArrangeByIndex as false in OnSizeAllocated” and it was working fine at our end. Also, we have attached the test sample for your reference. Please find the sample from the below link. 
 
  
If still you are facing the problem, Could you please share us the modified sample with issue reproduced state which will be helpful to provide you better solution at the earliest.  
 
Regards, 
Yuvaraj.


LR Lolo Rodri August 26, 2021 08:52 AM UTC

Hi Yuvaraj,

I was trying some cases and I realize that it throws an exception because when ScatterSeries load first time and ItemSource is an empty list crash. But if you put just one single data in list and after first time load you delete it dont crash. Maybe is a bug of initialitation?


Anyway is solved!


Thanks for everything,

Lolo.



YP Yuvaraj Palanisamy Syncfusion Team August 30, 2021 04:35 AM UTC

 
Thank you for your update. 
 
We can investigate the reported problem "Scatter series with empty datapoint collection throws exception" and the possible fix will be included in our essential studio Volume 3 release which is expected to rolled out on or before end September 2021.  

Please let us know if you have any concern. 
 
 
Regards,  
Yuvaraj. 


Loader.
Up arrow icon