Class PointLineSeries
- Namespace
- LightningChartLib.WinForms.Charting.SeriesXY
- Assembly
- LightningChart.WinForms.Charting.NET4.dll
Point line series. You can define the line style and point style. Add points with AddPoints method.
public class PointLineSeries : ProgressiveSingleLineSeriesBase, IChartNode, IDisposable, IHighlightingItem, ISingleLineSeriesSolveResultReturningSeries, ITrackable, ILevelTriggable, IRealtimeShiftable
- Inheritance
-
PointLineSeries
- Implements
- Inherited Members
Remarks
The points must be in successive order by X value. Make sure you keep them that way.
Constructors
PointLineSeries()
Constructor for Form designer list editor
public PointLineSeries()
PointLineSeries(ViewXY, AxisX, AxisY)
Constructor
public PointLineSeries(ViewXY owner, AxisX axisX, AxisY axisY)
Parameters
Properties
ContinuousOverScaleBreak
Draws a connecting line over ExcludeRange gap, if this flag is set.
public bool ContinuousOverScaleBreak { get; set; }
Property Value
CursorTrackEnabled
Cursor tracking enabled.
public bool CursorTrackEnabled { get; set; }
Property Value
ErrorBars
Error bars.
public ErrorBarSettings ErrorBars { get; set; }
Property Value
IndividualPointColoring
Selects how to use the individual point colors. Sets which PointStyle color is replaced with PointColor.
public PointColoringTarget IndividualPointColoring { get; set; }
Property Value
Points
Series points.
public SeriesPoint[] Points { get; set; }
Property Value
PointsType
Points type.
public PointsType PointsType { get; set; }
Property Value
PointsWithErrors
Series points with error tolerance indicators.
public SeriesErrorPoint[] PointsWithErrors { get; set; }
Property Value
RegressionFitting
Regression fitting to data points.
public Regression RegressionFitting { get; set; }
Property Value
RegressionPolyOrder
Polynomial regression order.
public int RegressionPolyOrder { get; set; }
Property Value
Remarks
Only effective when RegressionFitting is 'PolynomialFit'
ScrollModePointsKeepLevel
Tells how often the draw data is cleared when using X-axis scroll mode. Valid range is 1...100 1 frees the draw data and the reconstructs the draw data after every 1/10 scroll page. Use this when there's not much memory available. 100 frees the draw data and the reconstructs the draw data after every 100/10 = 10 pages. Use this when smooth scroll with high FPS is important. Reserves some extra memory.
public int ScrollModePointsKeepLevel { get; set; }
Property Value
ScrollingStabilizing
Stabilize scrolling mode by rounding shifting to nearest integer pixel position.
Reduces wobbling of the scrolling waveform, but may show as slight X-dimensional distortion.
public bool ScrollingStabilizing { get; set; }
Property Value
Methods
AddPoints(SeriesErrorPoint[], bool)
Add points with error tolerance to end of series
public int AddPoints(SeriesErrorPoint[] points, bool invalidateChart)
Parameters
pointsSeriesErrorPoint[]Points
invalidateChartboolUpdate chart after adding. Updating will raise CPU load, so you maybe don't want to use this with every call if points are added many times per second.
Returns
- int
Point count after adding
AddPoints(SeriesPoint[], bool)
Add points to end of series
public int AddPoints(SeriesPoint[] points, bool invalidateChart)
Parameters
pointsSeriesPoint[]Points
invalidateChartboolUpdate chart after adding. Updating will raise CPU load, so you maybe don't want to use this with every call if points are added many times per second.
Returns
- int
Point count after AddPoints method call.
AddPoints(double[], double[], bool)
Add points to end of series
public int AddPoints(double[] xValues, double[] yValues, bool invalidateChart)
Parameters
xValuesdouble[]X values array
yValuesdouble[]Y values array
invalidateChartboolUpdate chart after adding. Updating will raise CPU load, so you maybe don't want to use this with every call if points are added many times per second.
Returns
- int
Point count after adding
Remarks
If X and Y array lenghts do not match, shorter array count of points are added
CheckDataPointsAreInAscendingOrder()
Check that rule X[i+1] >= X[i] is followed
public bool CheckDataPointsAreInAscendingOrder()
Returns
- bool
True if rule followed, or less than 2 points in the series. Else false.
Clear()
Clear all points
public override void Clear()
Construct()
Create members.
protected override void Construct()
DeletePointsBeforeX(double)
Delete points having smaller X value than given value
public void DeletePointsBeforeX(double xValue)
Parameters
xValuedoubleparam xValue M:LightningChartLib.WinForms.Charting.SeriesXY.PointLineSeries.DeletePointsBeforeX(System.Double)
Dispose(bool)
Clean up any resources being used.
protected override void Dispose(bool disposing)
Parameters
disposingbooltrue if managed resources should be disposed, otherwise false.
GetMinMaxFromXRange(out double, out double, double, double, bool)
Get min and max Y value within given X range
public override bool GetMinMaxFromXRange(out double yMin, out double yMax, double xRangeMin, double xRangeMax, bool ignoreZeros)
Parameters
yMindoubleMinimum Y value
yMaxdoubleMaximum Y value
xRangeMindoubleX range start
xRangeMaxdoubleX range end
ignoreZerosboolIgnore zeros
Returns
- bool
True if values were successfully detected
GetMinMaxFromXRangeIgnoreValue(out double, out double, double, double, double)
This is similar to GetMinMaxFromXRange, but tailored for Series wth DataBreaking. Get min and max Y value within given X range, but Ignore some values (gap defining value)
public override bool GetMinMaxFromXRangeIgnoreValue(out double yMin, out double yMax, double xRangeMin, double xRangeMax, double dIgnoreValue)
Parameters
yMindoubleMinimum Y value
yMaxdoubleMaximum Y value
xRangeMindoubleX range start
xRangeMaxdoubleX range end
dIgnoreValuedoubleGap defining value
Returns
- bool
True if values were successfully detected
GetRegressionFactors()
Get the factors that are used in regression line plotting
public double[] GetRegressionFactors()
Returns
- double[]
Factors, length = polynomial order+1. For example, when having order 2, you can plot line with equation: Y = factors[0] + factors[1]*X + factors[2]*X^2
Remarks
Factors are valid only after the line has been rendered, after applying new data points or regression settings
GetXMinMax(out double, out double)
Get minimum X and maximum X of series X values
public override bool GetXMinMax(out double xMin, out double xMax)
Parameters
Returns
- bool
True if minimum X and maximum X was obtained successfully
GetXValues()
Get X values array.
public double[] GetXValues()
Returns
- double[]
X values array
Remarks
This iterates through the Points list, making it slower than direct accessing with Points array.
GetYValues()
Get Y values array.
public double[] GetYValues()
Returns
- double[]
Y values array
Remarks
This iterates through the Points list, making it slower than direct accessing with Points array.
InvalidateData()
Invalidate data array. Statistics and draw data are recalculated.
public override void InvalidateData()
LoadFromCSV(string, SeparatorCSV)
Loads series data from a CSV file.
public override bool LoadFromCSV(string file, SeparatorCSV separator)
Parameters
filestringCSV file name. If file does not exist, LoadFromCSV returns false.
separatorSeparatorCSVValue and floating point number separator.
Returns
- bool
True if import succeeds. Otherwise false.
OnDeserialized(StreamingContext)
OnDeserialized is called just after the object has been deserialized
[OnDeserialized]
protected void OnDeserialized(StreamingContext context)
Parameters
contextStreamingContextContext
SaveToCSV(string, SeparatorCSV)
Saves series data into CSV file
public override bool SaveToCSV(string file, SeparatorCSV separator)
Parameters
filestringTarget file. If file already exists, it will be overwritten.
separatorSeparatorCSVValue and floating point number separator definition
Returns
- bool
True if save is successful
SeekTriggerPos(out double, double, double, double, TriggeringEdge)
Detect triggering position from series data
public bool SeekTriggerPos(out double trigPosX, double trigLevel, double seekStartX, double seekEndX, TriggeringEdge edge)
Parameters
trigPosXdoubleOutput triggered X position
trigLeveldoubleTrigger level Y value
seekStartXdoubleMinimum X value that is investigated
seekEndXdoubleMaximum X value that is investigated
edgeTriggeringEdgeTriggering edge
Returns
- bool
True if trigger position was detected, else false.
SeekVisibleRangeStartPointIndex(double, int)
Seek visible range first series point index (actually one point before that)
protected int SeekVisibleRangeStartPointIndex(double startXValue, int currentRangeStartPointIndex)
Parameters
Returns
- int
Start point index. If unable to find start point, returns -1
Remarks
Always make sure m_points are locked before calling this method
SetValues(double[], double[])
Fill Points array from X and Y values
public void SetValues(double[] xValues, double[] yValues)
Parameters
SetXValue(int, double)
Set X value of Points array item.
public void SetXValue(int index, double xValue)
Parameters
Remarks
Does not invalidate the data. Call InvalidateData() after you have set all values.
SetYValue(int, double)
Set Y value of Points array item.
public void SetYValue(int index, double yValue)
Parameters
Remarks
Does not invalidate the data. Call InvalidateData() after you have set all values.
SolveNearestDataPointByCoord(int, int, out double, out double, out int)
Solve nearest data point to given X and Y screen coordinate [input in DIP].
public bool SolveNearestDataPointByCoord(int xCoordinate, int yCoordinate, out double nearestPointXValue, out double nearestPointYValue, out int nearestIndex)
Parameters
xCoordinateintX screen coordinate as DIP
yCoordinateintY screen coordinate as DIP
nearestPointXValuedoubleNearest data point X
nearestPointYValuedoubleNearest data point Y
nearestIndexintNearest data point index in the Points or PointsWithErrors array
Returns
- bool
True if successfully solved
SolveNearestDataPointByValue(double, double, out double, out double, out int)
Solve nearest data point to given X and Y value.
public bool SolveNearestDataPointByValue(double xValue, double yValue, out double nearestPointXValue, out double nearestPointYValue, out int nearestIndex)
Parameters
xValuedoubleX value
yValuedoubleY value
nearestPointXValuedoubleNearest data point X
nearestPointYValuedoubleNearest data point Y
nearestIndexintNearest data point index in the Points or PointsWithErrors array.
Returns
- bool
True if successfully solved
Remarks
The distance of given X and Y values and each data point is compared in screen coordinates.
SolveYValueAtXValue(double)
Solve y-value or range on given x-value.
public override LineSeriesValueSolveResult SolveYValueAtXValue(double x)
Parameters
xdoublex-value
Returns
- LineSeriesValueSolveResult
Solve status.
Events
OldDataDropped
Occurs when old data points have been dropped.
public event PointLineSeries.OldDataDroppedHandler OldDataDropped