StrokeStyle
[Serializable]public struct StrokeStyleThe characteristics of a stroke that traces a path. Swift Charts equivalent: StrokeStyle
Usage:
// Solid 2px line
var solid = new StrokeStyle(lineWidth: 2f);
// Dashed line with 5px dash, 3px gap
var dashed = new StrokeStyle(lineWidth: 1f, dash: new float[] { 5, 3 });
// Dotted line
var dotted = new StrokeStyle(lineWidth: 2f, dash: new float[] { 2, 4 });
Fields
Section titled “Fields”
LineWidth
Section titled “LineWidth”[Tooltip("Stroke width of the line in pixels.")][Range(0.1, 30)]public float LineWidthThe width of the stroked path.
Returns
System.Single — No return description is available.
LineCap
Section titled “LineCap”[Tooltip("How line endpoints are rendered (Butt, Round, or Square).")]public LineCap LineCapThe endpoint style of a line.
Returns
ChartGuru.LineCap — No return description is available.
LineJoin
Section titled “LineJoin”[Tooltip("How corners are rendered where two line segments meet.")]public LineJoin LineJoinThe join type of a line.
Returns
ChartGuru.LineJoin — No return description is available.
MiterLimit
Section titled “MiterLimit”[Tooltip("Threshold for switching from a miter to a bevel join at sharp corners. Higher values permit sharper miters.")][Range(1, 50)]public float MiterLimitA threshold used to determine whether to use a bevel instead of a miter at a join.
Returns
System.Single — No return description is available.
public float[] DashThe lengths of painted and unpainted segments used to make a dashed line. Empty or null for solid lines. Example: [5, 3] = 5px dash, 3px gap, repeating. Example: [10, 5, 2, 5] = 10px dash, 5px gap, 2px dash, 5px gap, repeating.
Returns
System.Single[] — No return description is available.
DashPhase
Section titled “DashPhase”[Tooltip("Offset in pixels into the dash pattern where drawing begins.")]public float DashPhaseHow far into the dash pattern the line starts.
Returns
System.Single — No return description is available.
Properties
Section titled “Properties”
IsDashed
Section titled “IsDashed”public bool IsDashed { get; }Returns true if this stroke style uses a dash pattern.
Returns
System.Boolean — No return description is available.
Default
Section titled “Default”public static StrokeStyle Default { get; }Default solid stroke style with 2px width.
Returns
ChartGuru.StrokeStyle — No return description is available.
Constructors
Section titled “Constructors”
StrokeStyle(float, LineCap, LineJoin, float, float[], float)
Section titled “StrokeStyle(float, LineCap, LineJoin, float, float[], float)”public StrokeStyle(float lineWidth = 2, LineCap lineCap = LineCap.Round, LineJoin lineJoin = LineJoin.Round, float miterLimit = 10, float[] dash = null, float dashPhase = 0)Creates a new stroke style with the given components. Swift Charts equivalent: StrokeStyle(lineWidth:lineCap:lineJoin:miterLimit:dash:dashPhase:)
Parameters
| Name | Type | Description |
|---|---|---|
lineWidth |
System.Single | |
lineCap |
ChartGuru.LineCap | |
lineJoin |
ChartGuru.LineJoin | |
miterLimit |
System.Single | |
dash |
System.Single[] | |
dashPhase |
System.Single |
Methods
Section titled “Methods”
Solid(float)
Section titled “Solid(float)”public static StrokeStyle Solid(float lineWidth = 2)Creates a solid stroke style with the given line width.
Parameters
| Name | Type | Description |
|---|---|---|
lineWidth |
System.Single |
Returns
ChartGuru.StrokeStyle — No return description is available.
Dashed(float, float, float)
Section titled “Dashed(float, float, float)”public static StrokeStyle Dashed(float lineWidth = 2, float dashLength = 5, float gapLength = 3)Creates a dashed stroke style with the given line width and dash pattern.
Parameters
| Name | Type | Description |
|---|---|---|
lineWidth |
System.Single | |
dashLength |
System.Single | |
gapLength |
System.Single |
Returns
ChartGuru.StrokeStyle — No return description is available.
Dotted(float)
Section titled “Dotted(float)”public static StrokeStyle Dotted(float lineWidth = 2)Creates a dotted stroke style with the given line width.
Parameters
| Name | Type | Description |
|---|---|---|
lineWidth |
System.Single |
Returns
ChartGuru.StrokeStyle — No return description is available.
DashDot(float)
Section titled “DashDot(float)”public static StrokeStyle DashDot(float lineWidth = 2)Creates a dash-dot pattern stroke style.
Parameters
| Name | Type | Description |
|---|---|---|
lineWidth |
System.Single |
Returns
ChartGuru.StrokeStyle — No return description is available.