Table of Contents

Interface IDataSource

Namespace
ScottPlot
Assembly
ScottPlot.dll

Internal interface used for Utility Functions within DataSourceUtilities

public interface IDataSource
Extension Methods

Properties

Length

The length of the collection

int Length { get; }

Property Value

int

MaxRenderIndex

int MaxRenderIndex { get; }

Property Value

int

MinRenderIndex

int MinRenderIndex { get; }

Property Value

int

PreferCoordinates

When set true, DataSourceUtilities should prefer paths that utilize GetCoordinates

bool PreferCoordinates { get; }

Property Value

bool

Methods

GetCoordinate(int)

Gets the X-Y coordinate from the data source at the specified index

Coordinates GetCoordinate(int index)

Parameters

index int

Returns

Coordinates

GetCoordinateScaled(int)

Gets the X-Y coordinate from the data source at the specified index with any offsets and scaling applied

Coordinates GetCoordinateScaled(int index)

Parameters

index int

Returns

Coordinates

GetX(int)

Gets the X value from the data source at the specified index

double GetX(int index)

Parameters

index int

Returns

double

GetXClosestIndex(Coordinates)

Gets the closest index to a specified coordinate for the array of X's

int GetXClosestIndex(Coordinates mouseLocation)

Parameters

mouseLocation Coordinates

typically the X coordinate should be used, unless the plot is rotated (then use Y)

Returns

int

Remarks

Fastest execution should be using a BinarySearch, such as GetClosestIndex(double[], double, IndexRange)

GetXScaled(int)

Gets the X value from the data source at the specified index with any offsets and scaling applied

double GetXScaled(int index)

Parameters

index int

Returns

double

GetY(int)

Gets the Y value from the data source at the specified index

double GetY(int index)

Parameters

index int

Returns

double

GetYScaled(int)

Gets the Y value from the data source at the specified index with any offsets and scaling applied

double GetYScaled(int index)

Parameters

index int

Returns

double

IsSorted()

When the collection is sorted, this will enable much quicker execution by allowing usage of BinarySearch methods ( GetNearest should call GetXClosestIndex when this is true )

bool IsSorted()

Returns

bool