Click or drag to resize

IChartTrendLine InterceptIsAuto Property

True if the point where the trendline crosses the value axis is automatically determined by the regression.
Examples
The following code illustrates how to check whether the IChartTrendLine object intercept value is automatic or not:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Create chart</para><para>Chart chart = worksheet.Charts.Add(ExcelChartType.ScatterMarkers);</para><para>//Add serie and set serie Y and X Values</para><para>IChartSerie serie = chart.Series.Add();</para><para>serie.Values = worksheet.Range["A2:C2"];</para><para>serie.CategoryLabels = worksheet.Range["A1:C1"];</para><para>//Get chart trendlines collection and Add trendline</para><para>IChartTrendLines trendLines = serie.TrendLines;</para><para>IChartTrendLine trendline = trendLines.Add();</para><para>//Set intercept value</para><para>trendline.Intercept = 10;</para><para>//Check trendline intercept is automatic</para><para>Console.WriteLine("Is Trendline Intercept value is automatic:" + trendline.InterceptIsAuto.ToString());</para><para>//Save to file</para><para>workbook.SaveToFile("Chart.xlsx");</para>

Namespace: Spire.Xls.Core
Assembly: Spire.XLS (in Spire.XLS.dll) Version: 15.4.0.0 (15.4.0.5046)
Syntax
bool InterceptIsAuto { get; }

Property Value

Type: Boolean
See Also