ScottPlot
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Properties | List of all members
ScottPlot.LabelStyle Class Reference
Inheritance diagram for ScottPlot.LabelStyle:
ScottPlot.Label

Public Member Functions

void SetBestFont ()
 Use the characters in Text to determine an installed system font most likely to support this character set.
 
void ApplyToPaint (SKPaint paint)
 
MeasuredText Measure ()
 Return size information for the contents of the Text property.
 
MeasuredText Measure (string text)
 Return size information for the given text.
 
MeasuredText Measure (string text, SKPaint paint)
 
Pixel GetRenderLocation (PixelRect rect, Alignment rectAlignment, float offsetX, float offsetY, SKPaint paint)
 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 ).
 
void Render (SKCanvas canvas, Pixel px, SKPaint paint, string text, bool bottom=true)
 
void Render (SKCanvas canvas, Pixel px, SKPaint paint, bool bottom=true)
 
string float height MeasureHighestString (string[] strings, SKPaint paint)
 
string PixelLength width MeasureWidestString (string[] strings, SKPaint paint)
 

Public Attributes

bool Italic = false
 
bool AntiAlias = true
 
float PointSize = 0
 
bool PointFilled = false
 
Color PointColor = Colors.Magenta
 
float OffsetX = 0
 
float OffsetY = 0
 
float BorderRadiusX = 0
 
float BorderRadiusY = 0
 
string text
 

Properties

static bool RTLSupport = false [get, set]
 Set this to globally enable support for right-to-left (RTL) languages.
 
bool IsVisible = true [get, set]
 
string Text = string.Empty [get, set]
 
Alignment Alignment = Alignment.UpperLeft [get, set]
 
float Rotation = 0 [get, set]
 Rotation in degrees clockwise from 0 (horizontal text)
 
Color ForeColor = Colors.Black [get, set]
 
Color BackColor [get, set]
 
Color BackgroundColor = Colors.Transparent [get, set]
 
Color BorderColor = Colors.Transparent [get, set]
 
float BorderWidth = 1 [get, set]
 
PixelRect LastRenderPixelRect [get]
 
Color ShadowColor = Colors.Transparent [get, set]
 
PixelOffset ShadowOffset = new(3, 3) [get, set]
 
bool AntiAliasBackground = true [get, set]
 
bool AntiAliasText = true [get, set]
 
bool SubpixelText = true [get, set]
 
string FontName = Fonts.Default [get, set]
 
float FontSize = 12 [get, set]
 
bool Bold = false [get, set]
 
float? LineSpacing = null [get, set]
 Manually defined line height in pixels. If not defined, the default line spacing will be used (according to the typeface, size, etc.)
 
float Padding [get, set]
 
PixelPadding PixelPadding = new(0, 0, 0, 0) [get, set]
 
float BorderRadius [get, set]
 
ImageImage = null [get, set]
 If supplied, this label will be displayed as an image and its text and styling properties will be ignored.
 
static LabelStyle Default [get]
 

Member Function Documentation

◆ ApplyToPaint()

void ScottPlot.LabelStyle.ApplyToPaint ( SKPaint  paint)
inline

◆ GetRenderLocation()

Pixel ScottPlot.LabelStyle.GetRenderLocation ( PixelRect  rect,
Alignment  rectAlignment,
float  offsetX,
float  offsetY,
SKPaint  paint 
)
inline

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 ).

◆ Measure() [1/3]

MeasuredText ScottPlot.LabelStyle.Measure ( )
inline

Return size information for the contents of the Text property.

◆ Measure() [2/3]

MeasuredText ScottPlot.LabelStyle.Measure ( string  text)
inline

Return size information for the given text.

◆ Measure() [3/3]

MeasuredText ScottPlot.LabelStyle.Measure ( string  text,
SKPaint  paint 
)
inline

◆ MeasureHighestString()

string float height ScottPlot.LabelStyle.MeasureHighestString ( string[]  strings,
SKPaint  paint 
)
inline

◆ MeasureWidestString()

string PixelLength width ScottPlot.LabelStyle.MeasureWidestString ( string[]  strings,
SKPaint  paint 
)
inline

◆ Render() [1/2]

void ScottPlot.LabelStyle.Render ( SKCanvas  canvas,
Pixel  px,
SKPaint  paint,
bool  bottom = true 
)
inline

◆ Render() [2/2]

void ScottPlot.LabelStyle.Render ( SKCanvas  canvas,
Pixel  px,
SKPaint  paint,
string  text,
bool  bottom = true 
)
inline

◆ SetBestFont()

void ScottPlot.LabelStyle.SetBestFont ( )
inline

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

Member Data Documentation

◆ AntiAlias

bool ScottPlot.LabelStyle.AntiAlias = true

◆ BorderRadiusX

float ScottPlot.LabelStyle.BorderRadiusX = 0

◆ BorderRadiusY

float ScottPlot.LabelStyle.BorderRadiusY = 0

◆ Italic

bool ScottPlot.LabelStyle.Italic = false

◆ OffsetX

float ScottPlot.LabelStyle.OffsetX = 0

◆ OffsetY

float ScottPlot.LabelStyle.OffsetY = 0

◆ PointColor

Color ScottPlot.LabelStyle.PointColor = Colors.Magenta

◆ PointFilled

bool ScottPlot.LabelStyle.PointFilled = false

◆ PointSize

float ScottPlot.LabelStyle.PointSize = 0

◆ text

string ScottPlot.LabelStyle.text

Property Documentation

◆ Alignment

Alignment ScottPlot.LabelStyle.Alignment = Alignment.UpperLeft
getset

◆ AntiAliasBackground

bool ScottPlot.LabelStyle.AntiAliasBackground = true
getset

◆ AntiAliasText

bool ScottPlot.LabelStyle.AntiAliasText = true
getset

◆ BackColor

Color ScottPlot.LabelStyle.BackColor
getset

◆ BackgroundColor

Color ScottPlot.LabelStyle.BackgroundColor = Colors.Transparent
getset

◆ Bold

bool ScottPlot.LabelStyle.Bold = false
getset

◆ BorderColor

Color ScottPlot.LabelStyle.BorderColor = Colors.Transparent
getset

◆ BorderRadius

float ScottPlot.LabelStyle.BorderRadius
getset

◆ BorderWidth

float ScottPlot.LabelStyle.BorderWidth = 1
getset

◆ Default

LabelStyle ScottPlot.LabelStyle.Default
staticget

◆ FontName

string ScottPlot.LabelStyle.FontName = Fonts.Default
getset

◆ FontSize

float ScottPlot.LabelStyle.FontSize = 12
getset

◆ ForeColor

Color ScottPlot.LabelStyle.ForeColor = Colors.Black
getset

◆ Image

Image? ScottPlot.LabelStyle.Image = null
getset

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

◆ IsVisible

bool ScottPlot.LabelStyle.IsVisible = true
getset

◆ LastRenderPixelRect

PixelRect ScottPlot.LabelStyle.LastRenderPixelRect
get

◆ LineSpacing

float? ScottPlot.LabelStyle.LineSpacing = null
getset

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

◆ Padding

float ScottPlot.LabelStyle.Padding
getsetadd

◆ PixelPadding

PixelPadding ScottPlot.LabelStyle.PixelPadding = new(0, 0, 0, 0)
getset

◆ Rotation

float ScottPlot.LabelStyle.Rotation = 0
getset

Rotation in degrees clockwise from 0 (horizontal text)

◆ RTLSupport

bool ScottPlot.LabelStyle.RTLSupport = false
staticgetset

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

◆ ShadowColor

Color ScottPlot.LabelStyle.ShadowColor = Colors.Transparent
getset

◆ ShadowOffset

PixelOffset ScottPlot.LabelStyle.ShadowOffset = new(3, 3)
getset

◆ SubpixelText

bool ScottPlot.LabelStyle.SubpixelText = true
getset

◆ Text

string ScottPlot.LabelStyle.Text = string.Empty
getset

The documentation for this class was generated from the following file: