VectSharp 2.6.1
A light library for C# vector graphics
All Classes Namespaces Functions Variables Enumerations Properties Events Pages
VectSharp.Plots.PolynomialTrendLine Class Reference

A plot element that draws a polynomial trendline with equation y = a0 + a1 * x + a2 * x^2 + ... + aN * x^N. More...

Inheritance diagram for VectSharp.Plots.PolynomialTrendLine:

Public Member Functions

 PolynomialTrendLine (double[] coefficients, double minX, double minY, double maxX, double maxY, IContinuousCoordinateSystem coordinateSystem)
 Create a new LinearTrendLine instance, specifying the coefficients. More...
 
 PolynomialTrendLine (IReadOnlyList< IReadOnlyList< double > > data, int order, IContinuousCoordinateSystem coordinateSystem, double? fixedIntercept=null)
 Create a new PolynomialTrendLine instance, determining the coefficients by running a regression. More...
 
 PolynomialTrendLine (IReadOnlyList<(double, double)> data, int order, IContinuousCoordinateSystem coordinateSystem, double? fixedIntercept=null)
 Create a new PolynomialTrendLine instance, determining the coefficients by running a regression. More...
 
void Plot (Graphics target)
 Draw the plot element on the specified target &#160;Graphics.
Parameters
targetThe Graphics on which to draw.
More...
 
void Plot (Graphics target)
 Draw the plot element on the specified target &#160;Graphics. More...
 

Properties

double[] Coefficients [get, set]
 The coefficients (a0 ... aN). More...
 
double MinX [get, set]
 The minimum X value for which the trendline is plotted. More...
 
double MinY [get, set]
 The minimum Y value for which the trendline is plotted. More...
 
double MaxX [get, set]
 The maximum X value for which the trendline is plotted. More...
 
double MaxY [get, set]
 The maximum Y value for which the trendline is plotted. More...
 
PlotElementPresentationAttributes PresentationAttributes = new PlotElementPresentationAttributes() { LineDash = new LineDash(5, 5, 0), Stroke = Colour.FromRgb(180, 180, 180) } [get, set]
 Presentation attributes for the trendline. More...
 
string Tag [get, set]
 A tag to identify the trendline in the plot. More...
 
IContinuousCoordinateSystem CoordinateSystem [get, set]
 The coordinate system used to transform the points from data space to plot space. More...
 
- Properties inherited from VectSharp.Plots.IPlotElement
ICoordinateSystem CoordinateSystem [get]
 The coordinate system used to transform the points from data space to plot space. More...
 

Detailed Description

A plot element that draws a polynomial trendline with equation y = a0 + a1 * x + a2 * x^2 + ... + aN * x^N.

Definition at line 685 of file Trendlines.cs.

Constructor & Destructor Documentation

◆ PolynomialTrendLine() [1/3]

VectSharp.Plots.PolynomialTrendLine.PolynomialTrendLine ( double[]  coefficients,
double  minX,
double  minY,
double  maxX,
double  maxY,
IContinuousCoordinateSystem  coordinateSystem 
)

Create a new LinearTrendLine instance, specifying the coefficients.

Parameters
coefficientsThe coefficients (a0 ... aN).
minXThe minimum X value for which the trendline is plotted.
minYThe minimum Y value for which the trendline is plotted.
maxXThe maximum X value for which the trendline is plotted.
maxYThe maximum Y value for which the trendline is plotted.
coordinateSystemThe coordinate system used to transform the points from data space to plot space.

Definition at line 736 of file Trendlines.cs.

◆ PolynomialTrendLine() [2/3]

VectSharp.Plots.PolynomialTrendLine.PolynomialTrendLine ( IReadOnlyList< IReadOnlyList< double > >  data,
int  order,
IContinuousCoordinateSystem  coordinateSystem,
double?  fixedIntercept = null 
)

Create a new PolynomialTrendLine instance, determining the coefficients by running a regression.

Parameters
dataThe data that will be used to determine the coefficients.
orderThe order of the polynomial (N). This must be ≥ 2.
coordinateSystemThe coordinate system used to transform the points from data space to plot space.
fixedInterceptIf this is null, the intercept (a0) is determined during the regression; otherwise, it is fixed to the specified value.
Exceptions
ArgumentOutOfRangeExceptionThrown if the order is < 2.

Definition at line 777 of file Trendlines.cs.

◆ PolynomialTrendLine() [3/3]

VectSharp.Plots.PolynomialTrendLine.PolynomialTrendLine ( IReadOnlyList<(double, double)>  data,
int  order,
IContinuousCoordinateSystem  coordinateSystem,
double?  fixedIntercept = null 
)

Create a new PolynomialTrendLine instance, determining the coefficients by running a regression.

Parameters
dataThe data that will be used to determine the coefficients.
orderThe order of the polynomial (N). This must be ≥ 2.
coordinateSystemThe coordinate system used to transform the points from data space to plot space.
fixedInterceptIf this is null, the intercept (a0) is determined during the regression; otherwise, it is fixed to the specified value.
Exceptions
ArgumentOutOfRangeExceptionThrown if the order is < 2.

Definition at line 830 of file Trendlines.cs.

Member Function Documentation

◆ Plot()

void VectSharp.Plots.PolynomialTrendLine.Plot ( Graphics  target)

Draw the plot element on the specified target &#160;Graphics.

Parameters
targetThe Graphics on which to draw.

Implements VectSharp.Plots.IPlotElement.

Definition at line 833 of file Trendlines.cs.

Property Documentation

◆ Coefficients

double [] VectSharp.Plots.PolynomialTrendLine.Coefficients
getset

The coefficients (a0 ... aN).

Definition at line 690 of file Trendlines.cs.

◆ CoordinateSystem

IContinuousCoordinateSystem VectSharp.Plots.PolynomialTrendLine.CoordinateSystem
getset

The coordinate system used to transform the points from data space to plot space.

Implements VectSharp.Plots.IPlotElement.

Definition at line 724 of file Trendlines.cs.

◆ MaxX

double VectSharp.Plots.PolynomialTrendLine.MaxX
getset

The maximum X value for which the trendline is plotted.

Definition at line 704 of file Trendlines.cs.

◆ MaxY

double VectSharp.Plots.PolynomialTrendLine.MaxY
getset

The maximum Y value for which the trendline is plotted.

Definition at line 709 of file Trendlines.cs.

◆ MinX

double VectSharp.Plots.PolynomialTrendLine.MinX
getset

The minimum X value for which the trendline is plotted.

Definition at line 694 of file Trendlines.cs.

◆ MinY

double VectSharp.Plots.PolynomialTrendLine.MinY
getset

The minimum Y value for which the trendline is plotted.

Definition at line 699 of file Trendlines.cs.

◆ PresentationAttributes

PlotElementPresentationAttributes VectSharp.Plots.PolynomialTrendLine.PresentationAttributes = new PlotElementPresentationAttributes() { LineDash = new LineDash(5, 5, 0), Stroke = Colour.FromRgb(180, 180, 180) }
getset

Presentation attributes for the trendline.

Definition at line 714 of file Trendlines.cs.

◆ Tag

string VectSharp.Plots.PolynomialTrendLine.Tag
getset

A tag to identify the trendline in the plot.

Definition at line 719 of file Trendlines.cs.


The documentation for this class was generated from the following file: