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 trendline in a chart with XlsIO

As I can add trendline on a chart made with XlsIO?

Thanks.

6 Replies

AV Abirami Varadharajan Syncfusion Team August 2, 2016 05:05 AM UTC

Hi Juan, 
 
Thank you for contacting Syncfusion support. 
 
Yes, you can add trendline to the chart created using XlsIO. Kindly refer the below code snippet to achieve your requirement. 
 
Code Example: 
       chart.Series(0).TrendLines.Add(ExcelTrendLineType.Linear); 
 
We have also shared a sample for your reference, which can be downloaded from the following location. Kindly refer to this and let us know if it helps. 
 
 
Regards, 
Abirami. 



JU Juan August 2, 2016 05:38 AM UTC

Perfect!
Thank you so much for your help.


JU Juan August 2, 2016 05:44 AM UTC

A question more ... How can I put color to the trendline?

Thanks.



AV Abirami Varadharajan Syncfusion Team August 2, 2016 09:25 AM UTC

Hi Jaun, 
 
Thank you for updating us. 
 
Query 
Details 
How can I put color to the trendline? 
Kindly refer the below code for formatting the trendline. 
 
Code Example: 
        chart.Series(0).TrendLines(0).Border.LineColor = Color.Aquamarine 
        chart.Series(0).TrendLines(0).Border.LinePattern = ExcelChartLinePattern.Dash 
        chart.Series(0).TrendLines(0).Border.LineWeight = 3 
 
 
Please let us know if you have any concerns. 
 
Regards, 
Abirami. 



JU Juan August 2, 2016 09:31 AM UTC

Thank you very much for your quick response.

It has worked perfectly!

Thank you.



AV Abirami Varadharajan Syncfusion Team August 3, 2016 04:21 AM UTC

Hi Juan, 
 
We are glad that your requirement is fulfilled. Please let us know if you need any further assistance. 
 
Regards, 
Abirami. 


Loader.
Live Chat Icon For mobile
Up arrow icon