VectSharp 2.6.1
A light library for C# vector graphics
|
A plot element that draws a moving average trendline. More...
Public Member Functions | |||
MovingAverageTrendLine (IReadOnlyList< IReadOnlyList< double > > data, int period, ICoordinateSystem< IReadOnlyList< double > > coordinateSystem) | |||
Create a new MovingAverageTrendLine instance from the specified data. More... | |||
MovingAverageTrendLine (IReadOnlyList<(double, double)> data, int period, IContinuousCoordinateSystem coordinateSystem) | |||
Create a new MovingAverageTrendLine instance from the specified data. More... | |||
void | Plot (Graphics target) | ||
Draw the plot element on the specified target  Graphics.
| |||
void | Plot (Graphics target) | ||
Draw the plot element on the specified target  Graphics. More... | |||
Properties | |
IReadOnlyList< IReadOnlyList< double > > | Data [get, set] |
The data used to compute the moving average. These must be sorted in a sensible way. More... | |
Func< int, double[], double > | Weight = (int i, double[] d) => 1 [get, set] |
The weight function. This should accept two parameters: an int representing the difference in index between the point being weighted and the "focus point", and a double [] representing the difference in coordinates between the two points. It should return a double representing the weight (it does not need to be normalised). More... | |
int | Period [get, set] |
The number of points that are averaged to obtain the value for each point. This must be ≥ 0. 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... | |
ICoordinateSystem< IReadOnlyList< double > > | CoordinateSystem [get, set] |
The coordinate system used to transform the points from data space to plot space. More... | |
![]() | |
ICoordinateSystem | CoordinateSystem [get] |
The coordinate system used to transform the points from data space to plot space. More... | |
A plot element that draws a moving average trendline.
Definition at line 1074 of file Trendlines.cs.
VectSharp.Plots.MovingAverageTrendLine.MovingAverageTrendLine | ( | IReadOnlyList< IReadOnlyList< double > > | data, |
int | period, | ||
ICoordinateSystem< IReadOnlyList< double > > | coordinateSystem | ||
) |
Create a new MovingAverageTrendLine instance from the specified data.
data | The data used to compute the moving average. These must be sorted in a sensible way. |
period | The number of points that are averaged to obtain the value for each point. This must be ≥ 0. |
coordinateSystem | The coordinate system used to transform the points from data space to plot space. |
ArgumentOutOfRangeException | Thrown if the period is < 0. |
Definition at line 1117 of file Trendlines.cs.
VectSharp.Plots.MovingAverageTrendLine.MovingAverageTrendLine | ( | IReadOnlyList<(double, double)> | data, |
int | period, | ||
IContinuousCoordinateSystem | coordinateSystem | ||
) |
Create a new MovingAverageTrendLine instance from the specified data.
data | The data used to compute the moving average. These must be sorted in a sensible way. |
period | The number of points that are averaged to obtain the value for each point. This must be ≥ 0. |
coordinateSystem | The coordinate system used to transform the points from data space to plot space. |
ArgumentOutOfRangeException | Thrown if the period is < 0. |
Definition at line 1136 of file Trendlines.cs.
void VectSharp.Plots.MovingAverageTrendLine.Plot | ( | Graphics | target | ) |
Draw the plot element on the specified target  Graphics.
target | The Graphics on which to draw. |
Implements VectSharp.Plots.IPlotElement.
Definition at line 1139 of file Trendlines.cs.
|
getset |
The coordinate system used to transform the points from data space to plot space.
Implements VectSharp.Plots.IPlotElement.
Definition at line 1107 of file Trendlines.cs.
|
getset |
The data used to compute the moving average. These must be sorted in a sensible way.
Definition at line 1079 of file Trendlines.cs.
|
getset |
The number of points that are averaged to obtain the value for each point. This must be ≥ 0.
Definition at line 1092 of file Trendlines.cs.
|
getset |
Presentation attributes for the trendline.
Definition at line 1097 of file Trendlines.cs.
|
getset |
A tag to identify the trendline in the plot.
Definition at line 1102 of file Trendlines.cs.
|
getset |
The weight function. This should accept two parameters: an int
representing the difference in index between the point being weighted and the "focus point", and a double
[] representing the difference in coordinates between the two points. It should return a double
representing the weight (it does not need to be normalised).
Definition at line 1087 of file Trendlines.cs.