Table of Contents

Class LabelStyle

Namespace
ScottPlot
Assembly
ScottPlot.dll
public class LabelStyle
Inheritance
LabelStyle
Derived
Inherited Members
Extension Methods

Fields

AntiAlias

[Obsolete("use AntiAliasBackground and AntiAliasText", true)]
public bool AntiAlias

Field Value

bool

BorderRadiusX

public float BorderRadiusX

Field Value

float

BorderRadiusY

public float BorderRadiusY

Field Value

float

Italic

public bool Italic

Field Value

bool

OffsetX

public float OffsetX

Field Value

float

OffsetY

public float OffsetY

Field Value

float

PointColor

public Color PointColor

Field Value

Color

PointFilled

public bool PointFilled

Field Value

bool

PointSize

public float PointSize

Field Value

float

Properties

Alignment

public Alignment Alignment { get; set; }

Property Value

Alignment

AntiAliasBackground

public bool AntiAliasBackground { get; set; }

Property Value

bool

AntiAliasText

public bool AntiAliasText { get; set; }

Property Value

bool

BackgroundColor

public Color BackgroundColor { get; set; }

Property Value

Color

Bold

public bool Bold { get; set; }

Property Value

bool

BorderColor

public Color BorderColor { get; set; }

Property Value

Color

BorderRadius

public float BorderRadius { get; set; }

Property Value

float

BorderWidth

public float BorderWidth { get; set; }

Property Value

float

Default

public static LabelStyle Default { get; }

Property Value

LabelStyle

FontName

public string FontName { get; set; }

Property Value

string

FontSize

public float FontSize { get; set; }

Property Value

float

ForeColor

public Color ForeColor { get; set; }

Property Value

Color

Image

If supplied, this label will be displayed as an image and its text and styling properties will be ignored

public Image? Image { get; set; }

Property Value

Image

IsVisible

public bool IsVisible { get; set; }

Property Value

bool

LastRenderPixelRect

public PixelRect LastRenderPixelRect { get; }

Property Value

PixelRect

LineSpacing

Manually defined line height in pixels. If not defined, the default line spacing will be used (according to the typeface, size, etc.)

public float? LineSpacing { get; set; }

Property Value

float?

Padding

public float Padding { get; set; }

Property Value

float

PixelPadding

public PixelPadding PixelPadding { get; set; }

Property Value

PixelPadding

RTLSupport

Set this to globally enable support for right-to-left (RTL) languages

public static bool RTLSupport { get; set; }

Property Value

bool

Rotation

Rotation in degrees clockwise from 0 (horizontal text)

public float Rotation { get; set; }

Property Value

float

ShadowColor

public Color ShadowColor { get; set; }

Property Value

Color

ShadowOffset

public PixelOffset ShadowOffset { get; set; }

Property Value

PixelOffset

SubpixelText

public bool SubpixelText { get; set; }

Property Value

bool

Text

public string Text { get; set; }

Property Value

string

Methods

ApplyToPaint(SKPaint)

public void ApplyToPaint(SKPaint paint)

Parameters

paint SKPaint

GetRenderLocation(PixelRect, Alignment, float, float, SKPaint)

Use the Label's size and Alignment to determine where it should be drawn relative to the given rectangle (aligned to the rectangle according to rectAlignment).

public Pixel GetRenderLocation(PixelRect rect, Alignment rectAlignment, float offsetX, float offsetY, SKPaint paint)

Parameters

rect PixelRect
rectAlignment Alignment
offsetX float
offsetY float
paint SKPaint

Returns

Pixel

Measure()

Return size information for the contents of the Text property

public MeasuredText Measure()

Returns

MeasuredText

Measure(string)

Return size information for the given text

public MeasuredText Measure(string text)

Parameters

text string

Returns

MeasuredText

Measure(string, SKPaint)

public MeasuredText Measure(string text, SKPaint paint)

Parameters

text string
paint SKPaint

Returns

MeasuredText

MeasureHighestString(string[], SKPaint)

public (string text, float height) MeasureHighestString(string[] strings, SKPaint paint)

Parameters

strings string[]
paint SKPaint

Returns

(string text, float height)

MeasureWidestString(string[], SKPaint)

public (string text, PixelLength width) MeasureWidestString(string[] strings, SKPaint paint)

Parameters

strings string[]
paint SKPaint

Returns

(string text, PixelLength width)

Render(SKCanvas, Pixel, SKPaint, bool)

public void Render(SKCanvas canvas, Pixel px, SKPaint paint, bool bottom = true)

Parameters

canvas SKCanvas
px Pixel
paint SKPaint
bottom bool

Render(SKCanvas, Pixel, SKPaint, string, bool)

public void Render(SKCanvas canvas, Pixel px, SKPaint paint, string text, bool bottom = true)

Parameters

canvas SKCanvas
px Pixel
paint SKPaint
text string
bottom bool

SetBestFont()

Use the characters in Text to determine an installed system font most likely to support this character set.

public void SetBestFont()