Home     Products      Support      Corporate     Sign In 
Support Knowledge Base, Article 1266
Product
ExcelWriter
Version
6.x
Title
Linear type of trendline is not a part of the RegressionType Enumeration
Problem

In the current version of ExcelWriter, Linear is not a part of the RegressionType Enumeration for charts trendlines.

Therefore it is not possible to use the enumeration in order to create a linear trendline, like the one in the scatter chart below, in one step.

Solution

To create a linear trendline:

1) create a Polynomial trendline
2) set the RegressionValue to 1

[C#]
Trendline trend = oSeries.Trendlines.CreateTrendline(Trendline.Regression.Polynomial);
trend.RegressionValue = 1;
[VB.NET]
Dim trend As Trendline 
trend = oSeries.Trendlines.CreateTrendline(Trendline.Regression.Polynomial) 
trend.RegressionValue = 1

The linear trendline will be added to the RegressionType enumeration in a future version.

Created : 1/7/2008 11:11:37 AM (last modified : 5/29/2008 1:57:59 PM)
Rate this article!
 
Comments