Adding trendline programmatically will crash

Hi,
I,ve a problem in the code attached. 
If the line "this.chartControl1.Series[0].Trendlines.Add(trendline);" is commented the graph will plot correctly, but if it is included in code the application crash itself.
Best Regards.

Attachment: Polynomial_Graph_d1cb1348.zip

22 Replies 1 reply marked as answer

YP Yuvaraj Palanisamy Syncfusion Team March 16, 2021 06:20 PM UTC

Hi Massimo, 
 
Greetings from Syncfusion. 
 
We have analyzed your query and we can reproduce the reported problem at our end. Currently we are validating the issue and we will update you with complete details on or before 18th March 2021. 
 
Regards, 
Yuvaraj. 



YP Yuvaraj Palanisamy Syncfusion Team March 20, 2021 01:26 AM UTC

Hi Massimo, 
 
Sorry for the delay. 
 
We have validated your reported problem and we have considered this as an issue. And we will fix the issue and a patch for this fix as well as a feedback report, will be provide on or before 22nd March 2021. 
 
Regards, 
Yuvaraj.


YP Yuvaraj Palanisamy Syncfusion Team March 22, 2021 01:02 PM UTC

Hi Massimo, 
 
Thanks for your patience. 
 
On further analysis we have confirmed App crashes when adding trendline dynamically in WinForms chart” as an issue. The fix of the reported issue will be included in our weekly NuGet release which is expected to publish on April 13, 2021. We appreciate your patience until then. We will let you know once it gets rolled out.  
    
You can now track the status of your request, review the proposed resolution timeline and contact us for any further inquiries through this link.     
   
     
Note: The provided feedback link is private, and you need to login to view this feedback  
 
Regards, 
Yuvaraj. 



YP Yuvaraj Palanisamy Syncfusion Team April 14, 2021 03:31 PM UTC

Hi Massimo, 
 
Sorry for the delay. 
 
Due to some technical hurdles, we are not included the fix in the today weekly nuget. And we have fixed the reported issue and we will provide the patch for this fix on 15th April, 2021. We appreciate your patience until then. 
 
Regards, 
Yuvaraj. 



YP Yuvaraj Palanisamy Syncfusion Team April 15, 2021 11:22 AM UTC

Hi Massimo, 
 
Thanks for your patience. 
 
We have fixed the reported issue “App crashes when we add trendline dynamically” and due to some technical hurdles, we are not included this fix in the weekly nuget release. And we will include the fix in our upcoming weekly nuget release which will be rolled out on 20th April 2021. we will let you know once we rolled out. Also, we have generated the patch for this fix with version 19.1.0.54, until then please use the below patch  
   
   
 
   
Assembly Version: 19.1.0.54   
       
Disclaimer:     
    
Please note that we have created this patch for version 19.1.0.54 specifically to resolve the issue reported in this incident. If you have received other patches for the same version for other products, please apply all patches in the order received.   
 
For more details, please refer below kb to clear the cache:  
  
Regards, 
Yuvaraj.


MA Massimo April 20, 2021 07:07 AM UTC

Hi Yuvaraj,
today I updated with 19.1.0.57 and the trendline now didn't crash but sometimes it is not plot the effect is disappear and reappear.
I think there is some other to investigate.
Attached is the some code of the first post but updated to the last nuGet 19.1.0.57
Regards.

Attachment: Polynomial_Graph_46c956b1.zip


YP Yuvaraj Palanisamy Syncfusion Team April 21, 2021 02:21 PM UTC

Hi Massio, 

Currently we are investigating further, and we will update you with complete details on or before 23rd April, 2021. We appreciate your patience until then. 

Regards, 
Yuvaraj. 



SM Saravanan Madheswaran Syncfusion Team April 24, 2021 07:30 AM UTC

Hi Massio,  
  
Sorry for the continuous delay, we able to reproduce the reported issue while we have datapoints in seconds interval, our development team validating on this with high priority, we will update you the patch or solution on or before 27th April 2021. We appreciate your patience until then.  
 
Regards, 
Saravanan.  



MA Massimo April 27, 2021 09:23 AM UTC

Hi Saravanan,
the weekly NuGet version v19.1.0.58 does not solve the problem.
I'm looking forward to receiving your reply soon.
Regards,


YP Yuvaraj Palanisamy Syncfusion Team April 27, 2021 02:26 PM UTC

Hi Massimo,  
 
Sorry for the inconvenience. 
 
We have fixed the reported issue “Trendline disappear sometimes” and due to some technical hurdles, we are not included this fix in the today weekly nuget release. And we will include the fix in our upcoming weekly nuget release which will be rolled out on 6th April 2021. we will let you know once we rolled out. Also, we have generated the patch for this fix with version 19.1.0.54, until then please use the below patch  
    
    
    
    
Assembly Version: 19.1.0.54    
        
Disclaimer:      
     
Please note that we have created this patch for version 19.1.0.54 specifically to resolve the issue reported in this incident. If you have received other patches for the same version for other products, please apply all patches in the order received.    
  
For more details, please refer below kb to clear the cache:   
 
Regards,  
Yuvaraj.  



SM Saravanan Madheswaran Syncfusion Team April 30, 2021 04:43 PM UTC

Hi Massiomo,  
 
Sorry for wrong timeline updated, please check the patch provided and testing in progress, we will include the fix at public release based on your update.  
 
Thank you, 
Saravanan.  



MA Massimo April 30, 2021 06:20 PM UTC

Hi Saravanan,
as you can see in the attached with the patch is better but sometimes (about 1 to 10) the trandline is not drawed.
Wait for your kind reply.
Regards,

Attachment: Polynomial_Graph_d5281a4e.zip


YP Yuvaraj Palanisamy Syncfusion Team May 3, 2021 12:03 PM UTC

Hi Massimo,  
 
We have fixed the reported issue “Trendline disappear sometimes” and we have generated the patch for this fix. Also, we have modified some changes (Used System.Windows.Forms.Timer  instead of System.Timers.Timer and Start the timer in Loaded event) the provided sample, please find the code example below. 
 

private System.Timers.Timer timer = new System.Timers.Timer(); 
private System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer(); 
 
         public Form1() 
          { 
            InitializeComponent(); 
            this.Load += Form1_Load; 
            ……. 
                          
            this.timer.Interval = 900; 
            this.timer.Tick += new EventHandler(this.timer_Tick); 
        } 
 
        private void Form1_Load(object sender, EventArgs e) 
        { 
            timer.Start(); 
        } 


 
 
Please find the patch details from the below. 
    
    
    
    
Assembly Version: 19.1.0.54    
        
Disclaimer:      
     
Please note that we have created this patch for version 19.1.0.54 specifically to resolve the issue reported in this incident. If you have received other patches for the same version for other products, please apply all patches in the order received.    
 
Note: Please remove the cache before use this patch. 
 
For more details, please refer below kb to clear the cache:   
 
 
Please check and let us know whether the reported problem has been resolved or not. Based on your confirmation, we will check the possibility to include this fix in our upcoming official release.  
 
Regards,  
Yuvaraj.  



MA Massimo May 3, 2021 05:00 PM UTC

Hi Yuvaraj,
this patch works for me without using System.Windows.Forms.Timer instead of System.Timers.Timer.
So I'll keep using System.Timers.Timer.
In my opinion you can close the case and check the possibility to include this fix in the official release.
Regards,


YP Yuvaraj Palanisamy Syncfusion Team May 4, 2021 06:07 AM UTC

Hi Massimo, 

Thank you for your update. 

We will include the fix in our Essential Studio Volume1, 2021 SP1 release which will be rolled out on mid of May 2021. Once we rolled out, we will let you know, until then please use the patch.  
 
Regards, 
Yuvaraj. 



MA Massimo May 5, 2021 06:38 PM UTC

Dear Yuvaraj,
I'm very sorry but I think the problem is not completely solved. 
The polynomial shape it is almost always flat and not follow the points. It seems that not is calculated. Also using the suggested System.Windows.Forms.Timer(); 
Regards,

Attachment: Polynomial_Graph_57d018fb.zip


YP Yuvaraj Palanisamy Syncfusion Team May 6, 2021 04:09 PM UTC

Hi Massimo, 
 
We have forwarded this query to our development team and they need some more time validating on this and we will update you with complete details on or before 10th May 2021.  
 
Regards, 
Yuvaraj. 



LA Lavanya Anaimuthu Syncfusion Team May 10, 2021 12:17 PM UTC

Hi Massimo, 
 
Thanks for your patience.  
 
On further analysis of the reported issue, trendline issue will occur only in DateTime seconds data points. Due to minute value difference, trendline polynomial slope calculated wrongly. Because of difficulties facing in fixing this issue, we have achieved your requirement with help of CategoryAxis and ChartFormatAxisLabel event in Chart. Using this event, we have passed the exact date time value in X-Axis labels. Please find the code snippet. 
 
Code snippet: 
 
List<DateTime> ListOfDate = new List<DateTime>(); 
 
public Form1() 
{ 
            InitializeComponent(); 
 
            chartSeries.Style.Symbol.Shape = ChartSymbolShape.Circle; 
 
            this.chartControl1.PrimaryXAxis.ValueType = ChartValueType.Category; 
            this.chartControl1.ChartFormatAxisLabel += ChartControl1_ChartFormatAxisLabel; 
} 
 
 
private void ChartControl1_ChartFormatAxisLabel(object sender, ChartFormatAxisLabelEventArgs e) 
 { 
            if (e.AxisOrientation == ChartOrientation.Horizontal) 
            { 
                if (ListOfDate.Count > 0) 
                { 
                    e.Label = ListOfDate[Convert.ToInt32(e.Label)].ToString("HH:mm:ss"); 
                    e.Handled = true; 
                } 
            } 
 } 
 
private void timer_Tick(object sender, EventArgs e) 
{ 
            this.timer.Enabled = false; 
            try 
            { 
                ….. 
 
                    chartSeries.Points.Clear(); 
                    ListOfDate.Clear(); 
 
                    if (this.chartControl1.Series[0].Trendlines.Count > 0) this.chartControl1.Series[0].Trendlines.Remove(trendline); 
 
                    int index = 0; 
                    foreach (Monitor ElementoCorrente in UltimiN) 
                    { 
                        chartSeries.Points.Add(index.ToString(), ElementoCorrente.TP1); 
                        ListOfDate.Add(ElementoCorrente.Time); 
                        index++; 
                    } 
 
                    …… 
} 
 
 
And we have modified your sample, please download it from the below link. 
 
 
Note: We have modified your application with CategoryAxis, so previously provided custom patch no need and you can directly use our latest official weekly nuget.  
 
Please let us know if you need any further assistance on this. 
 
Thanks, 
Lavanya A. 


Marked as answer

MA Massimo May 10, 2021 03:52 PM UTC

Dear Lavanya A,
this is better than before, but just increasing the points eg. from 7 to 11 the result is wrong. Check at the attached please.
Regards,

Attachment: Polynomial_Graph_f211705c.zip


LA Lavanya Anaimuthu Syncfusion Team May 11, 2021 09:38 AM UTC

Hi Massimo, 
 
Thanks for the update. 
 
By default, the chart series SortPoints property value is true.  Since, series datapoints are sorted and rendered x values with sorted data when increasing the data count more than ten.  However, you can resolve this issue by setting SortPoints property value as false in ChartSeries. Please find the code snippet below. 
 
Code Snippet: 
public Form1() 
{ 
            …. 
 
            this.chartControl1.PrimaryXAxis.ValueType = ChartValueType.Category;           
            this.chartControl1.ChartFormatAxisLabel += ChartControl1_ChartFormatAxisLabel; 
 
            chartSeries.SortPoints = false; 
} 
 
Thanks, 
Lavanya A. 



MA Massimo May 11, 2021 02:34 PM UTC

Dear Lavanya A,
now I can consider closed the case. Many, many thanks.
Regards,



LA Lavanya Anaimuthu Syncfusion Team May 12, 2021 06:47 AM UTC

 
Hi Massimo, 
 
Thank you for your update. We are glad to know that the solution works at your end. 
 
Regards,
Lavanya A.
 
 


Loader.
Up arrow icon