Table of Contents

Class Scatter

Namespace
ScottPlot.Plottables
Assembly
ScottPlot.dll
public class Scatter : IPlottable, IHasLine, IHasMarker, IHasLegendText, IDataSource, IGetNearest
Inheritance
Scatter
Implements
Derived
Inherited Members
Extension Methods

Constructors

Scatter(IScatterSource)

public Scatter(IScatterSource data)

Parameters

data IScatterSource

Fields

ConnectStyle

The style of lines to use when connecting points.

public ConnectStyle ConnectStyle

Field Value

ConnectStyle

Properties

Axes

This object performs coordinate/pixel translation at render time based on the latest data area. It stores the axes to use for this plottable and also the data area (in pixels) updated just before each render. If this object is null it will be constructed using the default X and Y axes at render time.

public IAxes Axes { get; set; }

Property Value

IAxes

Color

public Color Color { get; set; }

Property Value

Color

ColorPositions

public List<Scatter.ColorPosition> ColorPositions { get; set; }

Property Value

List<Scatter.ColorPosition>

Data

public IScatterSource Data { get; }

Property Value

IScatterSource

FillY

public bool FillY { get; set; }

Property Value

bool

FillYAbove

public bool FillYAbove { get; set; }

Property Value

bool

FillYAboveColor

public Color FillYAboveColor { get; set; }

Property Value

Color

FillYBelow

public bool FillYBelow { get; set; }

Property Value

bool

FillYBelowColor

public Color FillYBelowColor { get; set; }

Property Value

Color

FillYColor

public Color FillYColor { get; set; }

Property Value

Color

FillYValue

public double FillYValue { get; set; }

Property Value

double

IsVisible

Toggles whether this plottable is shown and contributes to the automatic axis limit detection. The calling method will check this variable (it does not need to be checked inside the Render method).

public bool IsVisible { get; set; }

Property Value

bool

Label

[Obsolete("use LegendText")]
public string Label { get; set; }

Property Value

string

LegendItems

Items which will appear in the legend

public IEnumerable<LegendItem> LegendItems { get; }

Property Value

IEnumerable<LegendItem>

LegendText

If populated, this text appears in the legend

public string LegendText { get; set; }

Property Value

string

LineColor

public Color LineColor { get; set; }

Property Value

Color

LinePattern

public LinePattern LinePattern { get; set; }

Property Value

LinePattern

LineStyle

public LineStyle LineStyle { get; set; }

Property Value

LineStyle

LineWidth

public float LineWidth { get; set; }

Property Value

float

MarkerColor

public Color MarkerColor { get; set; }

Property Value

Color

MarkerFillColor

public Color MarkerFillColor { get; set; }

Property Value

Color

MarkerLineColor

public Color MarkerLineColor { get; set; }

Property Value

Color

MarkerLineWidth

public float MarkerLineWidth { get; set; }

Property Value

float

MarkerShape

public MarkerShape MarkerShape { get; set; }

Property Value

MarkerShape

MarkerSize

public float MarkerSize { get; set; }

Property Value

float

MarkerStyle

public MarkerStyle MarkerStyle { get; set; }

Property Value

MarkerStyle

MaxRenderIndex

public int MaxRenderIndex { get; set; }

Property Value

int

MinRenderIndex

public int MinRenderIndex { get; set; }

Property Value

int

OffsetX

public double OffsetX { get; set; }

Property Value

double

OffsetY

public double OffsetY { get; set; }

Property Value

double

PathStrategy

Strategy to use for generating the path used to connect points

public IPathStrategy PathStrategy { get; set; }

Property Value

IPathStrategy

ScaleX

public double ScaleX { get; set; }

Property Value

double

ScaleY

public double ScaleY { get; set; }

Property Value

double

Smooth

Controls whether points are connected by smooth or straight lines

public bool Smooth { set; }

Property Value

bool

SmoothTension

Setting this value enables Smooth and sets the curve tension. Low tensions tend to "overshoot" data points. High tensions begin to approach connecting points with straight lines.

public double SmoothTension { get; set; }

Property Value

double

Methods

GetAxisLimits()

Return the 2D area (in coordinate space) occupied by the data contained in this plottable

public AxisLimits GetAxisLimits()

Returns

AxisLimits

GetIDataSource()

Returns an optimized IDataSource to work with when having to iterate across the collection of points

public IDataSource GetIDataSource()

Returns

IDataSource

GetNearest(Coordinates, RenderDetails, float)

Return the point nearest a specific location given the X/Y pixel scaling information from a previous render. Will return None if the nearest point is greater than maxDistance pixels away.

public DataPoint GetNearest(Coordinates mouseLocation, RenderDetails renderInfo, float maxDistance = 15)

Parameters

mouseLocation Coordinates
renderInfo RenderDetails
maxDistance float

Returns

DataPoint

GetNearestX(Coordinates, RenderDetails, float)

Return the point nearest a specific X location given the X/Y pixel scaling information from a previous render. Will return None if the nearest point is greater than maxDistance pixels away.

public DataPoint GetNearestX(Coordinates mouseLocation, RenderDetails renderInfo, float maxDistance = 15)

Parameters

mouseLocation Coordinates
renderInfo RenderDetails
maxDistance float

Returns

DataPoint

GetStepDisplayPixels(Pixel[], bool)

Convert scatter plot points (connected by diagonal lines) to step plot points (connected by right angles) by inserting an extra point between each of the original data points to result in L-shaped steps.

public static Pixel[] GetStepDisplayPixels(Pixel[] pixels, bool right)

Parameters

pixels Pixel[]
right bool

Indicates that a line will extend to the right before rising or falling.

Returns

Pixel[]

Render(RenderPack)

Draw the data from this plottable into the data area defined in the Axes. By default the surface is already clipped to the data area, but this can be cleared inside the plottable.

public virtual void Render(RenderPack rp)

Parameters

rp RenderPack