Table of Contents

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

owner ViewXY

Owner view

axisX AxisX

X axis you want to bind

axisY AxisY

Y axis you want to bind

Properties

ContinuousOverScaleBreak

Draws a connecting line over ExcludeRange gap, if this flag is set.

public bool ContinuousOverScaleBreak { get; set; }

Property Value

bool

CursorTrackEnabled

Cursor tracking enabled.

public bool CursorTrackEnabled { get; set; }

Property Value

bool

ErrorBars

Error bars.

public ErrorBarSettings ErrorBars { get; set; }

Property Value

ErrorBarSettings

IndividualPointColoring

Selects how to use the individual point colors. Sets which PointStyle color is replaced with PointColor.

public PointColoringTarget IndividualPointColoring { get; set; }

Property Value

PointColoringTarget

Points

Series points.

public SeriesPoint[] Points { get; set; }

Property Value

SeriesPoint[]

PointsType

Points type.

public PointsType PointsType { get; set; }

Property Value

PointsType

PointsWithErrors

Series points with error tolerance indicators.

public SeriesErrorPoint[] PointsWithErrors { get; set; }

Property Value

SeriesErrorPoint[]

RegressionFitting

Regression fitting to data points.

public Regression RegressionFitting { get; set; }

Property Value

Regression

RegressionPolyOrder

Polynomial regression order.

public int RegressionPolyOrder { get; set; }

Property Value

int

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

int

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. Only applies when XAxis ScrollMode = Scrolling.ScrollMode

public bool ScrollingStabilizing { get; set; }

Property Value

bool

Methods

AddPoints(SeriesErrorPoint[], bool)

Add points with error tolerance to end of series

public int AddPoints(SeriesErrorPoint[] points, bool invalidateChart)

Parameters

points SeriesErrorPoint[]

Points

invalidateChart bool

Update 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

points SeriesPoint[]

Points

invalidateChart bool

Update 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

xValues double[]

X values array

yValues double[]

Y values array

invalidateChart bool

Update 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

xValue double
param 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

disposing bool

true 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

yMin double

Minimum Y value

yMax double

Maximum Y value

xRangeMin double

X range start

xRangeMax double

X range end

ignoreZeros bool

Ignore 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

yMin double

Minimum Y value

yMax double

Maximum Y value

xRangeMin double

X range start

xRangeMax double

X range end

dIgnoreValue double

Gap 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

xMin double

X min

xMax double

X max

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

file string

CSV file name. If file does not exist, LoadFromCSV returns false.

separator SeparatorCSV

Value 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

context StreamingContext

Context

SaveToCSV(string, SeparatorCSV)

Saves series data into CSV file

public override bool SaveToCSV(string file, SeparatorCSV separator)

Parameters

file string

Target file. If file already exists, it will be overwritten.

separator SeparatorCSV

Value 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

trigPosX double

Output triggered X position

trigLevel double

Trigger level Y value

seekStartX double

Minimum X value that is investigated

seekEndX double

Maximum X value that is investigated

edge TriggeringEdge

Triggering 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

startXValue double

Start x value

currentRangeStartPointIndex int

Current start point index

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

xValues double[]

X values array

yValues double[]

Y values array

SetXValue(int, double)

Set X value of Points array item.

public void SetXValue(int index, double xValue)

Parameters

index int

Point index in Points array

xValue double

X value

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

index int

Point index in Points array

yValue double

Y value

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

xCoordinate int

X screen coordinate as DIP

yCoordinate int

Y screen coordinate as DIP

nearestPointXValue double

Nearest data point X

nearestPointYValue double

Nearest data point Y

nearestIndex int

Nearest 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

xValue double

X value

yValue double

Y value

nearestPointXValue double

Nearest data point X

nearestPointYValue double

Nearest data point Y

nearestIndex int

Nearest 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

x double

x-value

Returns

LineSeriesValueSolveResult

Solve status.

Events

OldDataDropped

Occurs when old data points have been dropped.

public event PointLineSeries.OldDataDroppedHandler OldDataDropped

Event Type

PointLineSeries.OldDataDroppedHandler