Trendline not updating/has no data?

I am building an SfChart with a LineSeries, which gets data from an ObservableCollection<model> ItemSource, in which the model has a DateTime and a double for X & Y. The chart draws nicely and updates when a new element is added to the  ObservableCollection from elsewhere.

However, I have tried to add a Trendline, which either does not draw, or draws only a horizontal line, depending on what Type I choose. 

I create the Trendline as follows:


            Trendline trendline = new Trendline()

            {

                Label = "trend",

                IsTrendlineVisible = true,

                Stroke = new SolidColorBrush(Colors.Red),

                StrokeThickness = 2,

                Type = TrendlineType.Linear

            };

Then I attach the Trendline to the LineSeries and attach the LineSeries to the SfChart:

               LSeries.Trendlines.Add(trendline);

               chart.Series.Add(LSeries);


Perhaps the Trendline isn't being made aware of the new data? Is there some way to fix this? 



5 Replies

YP Yuvaraj Palanisamy Syncfusion Team July 5, 2021 12:25 PM UTC

Hi Ben, 

Greetings from Syncfusion. 
 
This is a general update to let you know that our support team has taken out your query and they are starting to work on it. We will share the possible solution with validated details on or before July 6th, 2021 EOD.  

Regards, 
Yuvaraj.


YP Yuvaraj Palanisamy Syncfusion Team July 6, 2021 01:08 PM UTC

Hi Ben, 
  
Thanks for your patience.  
  
On further analysis we have confirmed that the reported problem “Trendline does not rendered in datetime axis with linear type” as an issue, and the fix for the reported issue will be included in our upcoming weekly NuGet release which is expected to be roll out on 20th July 2021. We appreciate your patience until then. We will let you know once it gets rolled out.      
  
   
Note: The provided feedback link is private, and you need to login to view this feedback. 
 
Regards, 
Yuvaraj.  



BE Ben July 7, 2021 10:56 AM UTC

Many thanks for your reply. 

I am having a similar problem with trying to instantiate a CandleSeries on an SfChart and then update the data in real time, to add new candles to the series. The chart and series are generated in C#, not in XAML.

If there is no data when the chart and series are created, then new data added to the series is not shown. But if there is data provided when the chart and series are created, then new data can be added dynamically -- it can be seen. 

That problem has an obvious workaround (create 'dummy' data at creation, and then remove it when new data exists). But will the new release also fix this problem -- are they related? 

Many thanks again. 



YP Yuvaraj Palanisamy Syncfusion Team July 8, 2021 07:34 AM UTC

Hi Ben,

 
We have checked the reported the problem “Candle series not updated dynamic data” and it was working fine at our end. Also, we have attached the sample as per your requirement SfChart and CandleSeries are in C# with no data and dynamically add data for CandleSeries.  
 
Also, we have attached the test sample for your reference. Please find the sample from the below link. 
 
  
If still you are facing the same problem, could you please revert us the modified sample with issue reproduced state which will be helpful to serve you better solution at the earliest.  

Regards,
 
Yuvaraj. 



YP Yuvaraj Palanisamy Syncfusion Team July 20, 2021 05:16 AM UTC

Hi Ben, 
 
We are glad to announce that our weekly NuGet was rolled out and fix for the reported issue was included in the weekly NuGet.

NuGet Version: 19.2.0.48
 

We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.
 
 
Regards, 
Yuvaraj 


Loader.
Up arrow icon