Skip to content

ChartLayer

ClassChartGuruChartGuru
public sealed class ChartLayer

One mark layer of a ChartDefinition: a mark kind, the channels that map data columns or constants onto it, and its style. Several layers compose a chart the way several marks compose a Swift Charts Chart, for example bars plus a target rule.

public ChartLayer()

public ChartLayer(ChartLayerMark mark)

Creates a visible chart layer of the given mark kind with empty data channels and default styling.

Parameters

Name Type
mark ChartGuru.ChartLayerMark

public static ChartLayer Bar(string x, string y, string series = null)

Bars at X with height Y; several Y columns or a series column add series.

Parameters

Name Type
x System.String
y System.String
series System.String

Returns

ChartGuru.ChartLayer

public static ChartLayer Line(string x, string y, string series = null)

A line through X and Y per series.

Parameters

Name Type
x System.String
y System.String
series System.String

Returns

ChartGuru.ChartLayer

public static ChartLayer Point(string x, string y, string series = null)

Points at X and Y per series.

Parameters

Name Type
x System.String
y System.String
series System.String

Returns

ChartGuru.ChartLayer

public static ChartLayer Area(string x, string y, string series = null)

An area under Y per series.

Parameters

Name Type
x System.String
y System.String
series System.String

Returns

ChartGuru.ChartLayer

public static ChartLayer Sector(string angle, string category)

One sector per row, sized by the angle column and labeled by the category column.

Parameters

Name Type
angle System.String
category System.String

Returns

ChartGuru.ChartLayer

public static ChartLayer HorizontalRule(float y, string label = null)

A horizontal rule at a constant value, such as a target line.

Parameters

Name Type
y System.Single
label System.String

Returns

ChartGuru.ChartLayer

public static ChartLayer VerticalRule(float x, string label = null)

A vertical rule at a constant value.

Parameters

Name Type
x System.Single
label System.String

Returns

ChartGuru.ChartLayer

public static ChartLayer HeatMap(string x, string y, string value)

Heat-map cells at X and Y categories colored by a value column.

Parameters

Name Type
x System.String
y System.String
value System.String

Returns

ChartGuru.ChartLayer

SurfacePlot(string, string, string, string)

Section titled “SurfacePlot(string, string, string, string)”
public static ChartLayer SurfacePlot(string function, string xLabel = null, string yLabel = null, string zLabel = null)

A 3D surface y = f(x, z) from a named function, like Swift Charts' SurfacePlot(x:y:z:function:); the labels title the axes.

Parameters

Name Type
function System.String
xLabel System.String
yLabel System.String
zLabel System.String

Returns

ChartGuru.ChartLayer

Candlestick(string, string, string, string, string)

Section titled “Candlestick(string, string, string, string, string)”
public static ChartLayer Candlestick(string x, string open, string high, string low, string close)

Candlesticks at X from open, high, low and close columns.

Parameters

Name Type
x System.String
open System.String
high System.String
low System.String
close System.String

Returns

ChartGuru.ChartLayer

public ChartLayer Clone()

Returns a deep copy.

Returns

ChartGuru.ChartLayer

public string Name { get; set; }

Returns

System.String

public bool Visible { get; set; }

Returns

System.Boolean

public ChartLayerMark Mark { get; set; }

Returns

ChartGuru.ChartLayerMark

public ChartChannel X { get; }

Horizontal position, or the start of horizontal ranges: a category, number or date column, or a constant for vertical rules.

Returns

ChartGuru.ChartChannel

public ChartChannel Y { get; }

Vertical position or value; several columns make one series per column. Sector angle for pies and the row of horizontal range bars.

Returns

ChartGuru.ChartChannel

public ChartChannel XEnd { get; }

End of a horizontal range: range bars, rectangles and rule segments.

Returns

ChartGuru.ChartChannel

public ChartChannel YStart { get; }

Start of a vertical range: range bars, range areas and rectangles.

Returns

ChartGuru.ChartChannel

public ChartChannel YEnd { get; }

End of a vertical range.

Returns

ChartGuru.ChartChannel

public ChartChannel Series { get; }

Series grouping for long data, like .foregroundStyle(by:).

Returns

ChartGuru.ChartChannel

public ChartChannel Color { get; }

Color value: a continuous value such as heat-map intensity, a category, or HTML colors when ChartChannel.Literal is set.

Returns

ChartGuru.ChartChannel

public ChartChannel Size { get; }

Symbol size value, as in .symbolSize(by:), or diameters in points when ChartChannel.Literal is set.

Returns

ChartGuru.ChartChannel

public ChartChannel Symbol { get; }

Symbol shape grouping, as in .symbol(by:), or SymbolShape names when ChartChannel.Literal is set.

Returns

ChartGuru.ChartChannel

public ChartChannel Z { get; }

Depth for 3D charts.

Returns

ChartGuru.ChartChannel

public ChartChannel Open { get; }

Open price for candlesticks.

Returns

ChartGuru.ChartChannel

public ChartChannel High { get; }

High price for candlesticks.

Returns

ChartGuru.ChartChannel

public ChartChannel Low { get; }

Low price for candlesticks.

Returns

ChartGuru.ChartChannel

public ChartChannel Close { get; }

Close price for candlesticks.

Returns

ChartGuru.ChartChannel

public ChartChannel ZStart { get; }

Start of a depth range: 3D rectangles and rules along Z.

Returns

ChartGuru.ChartChannel

public ChartChannel ZEnd { get; }

End of a depth range.

Returns

ChartGuru.ChartChannel

public ChartChannel Opacity { get; }

Opacity per row from 0 to 1, like .opacity(_:) on single marks; multiplied with the layer opacity. Empty cells keep the layer opacity.

Returns

ChartGuru.ChartChannel

public ChartChannel Rotation { get; }

Point symbol rotation per row in degrees. Empty cells keep the symbol unrotated.

Returns

ChartGuru.ChartChannel

public ChartChannel ClipShape { get; }

ClipShape names per row, like .clipShape(Capsule()) on single marks. Empty cells do not clip.

Returns

ChartGuru.ChartChannel

public ChartLayerStyle Style { get; set; }

Returns

ChartGuru.ChartLayerStyle

public ChartLayerStyle3D Style3D { get; set; }

3D symbol, rotation, material and rule styling, read by Chart Guru 3D.

Returns

ChartGuru.ChartLayerStyle3D

public ChartLayerSurface Surface { get; set; }

The surface drawn by a ChartLayerMark.Surface layer.

Returns

ChartGuru.ChartLayerSurface

public bool IsAutomatic { get; }

True when no channel is bound. Automatic layers take their columns from the bound data by chart type, so a chart type plus a data source works without mapping columns by hand. A constant Series value only names the layer and leaves it automatic. A surface drawn from a named function reads no data and is never automatic.

Returns

System.Boolean