ChartChannel
public sealed class ChartChannelSerializable encoding of one visual channel, the equivalent of Swift Charts'
.value("Label", value): a data column (or several for wide data) or a constant, plus the
display label used for axis titles, legends and tooltips.
Methods
Section titled “Methods”
FromColumn(string, string)
Section titled “FromColumn(string, string)”public static ChartChannel FromColumn(string column, string label = null)Binds the channel to one column.
Parameters
| Name | Type |
|---|---|
column |
System.String |
label |
System.String |
Returns
ChartGuru.ChartChannel
FromColumns(params string[])
Section titled “FromColumns(params string[])”public static ChartChannel FromColumns(params string[] columns)Binds the channel to several columns; each becomes its own series.
Parameters
| Name | Type |
|---|---|
columns |
System.String[] |
Returns
ChartGuru.ChartChannel
FromConstant(float, string)
Section titled “FromConstant(float, string)”public static ChartChannel FromConstant(float value, string label = null)Binds the channel to a constant number.
Parameters
| Name | Type |
|---|---|
value |
System.Single |
label |
System.String |
Returns
ChartGuru.ChartChannel
FromConstant(string, string)
Section titled “FromConstant(string, string)”public static ChartChannel FromConstant(string value, string label = null)Binds the channel to a constant written in invariant text.
Parameters
| Name | Type |
|---|---|
value |
System.String |
label |
System.String |
Returns
ChartGuru.ChartChannel
SetColumns(params string[])
Section titled “SetColumns(params string[])”public void SetColumns(params string[] columns)Binds the channel to the given columns, or clears it when none are given.
Parameters
| Name | Type |
|---|---|
columns |
System.String[] |
SetConstant(string)
Section titled “SetConstant(string)”public void SetConstant(string value)Binds the channel to a constant written in invariant text, or clears it when the text is empty. On a Series channel the constant names every mark of the layer as one series.
Parameters
| Name | Type |
|---|---|
value |
System.String |
SetLabel(string)
Section titled “SetLabel(string)”public void SetLabel(string label)Sets the display label.
Parameters
| Name | Type |
|---|---|
label |
System.String |
Clear()
Section titled “Clear()”public void Clear()Clears the channel.
TryGetConstantNumber(out float)
Section titled “TryGetConstantNumber(out float)”public bool TryGetConstantNumber(out float value)Tries to read the constant as a number.
Parameters
| Name | Type |
|---|---|
value |
System.Single |
Returns
System.Boolean
Clone()
Section titled “Clone()”public ChartChannel Clone()Returns a deep copy.
Returns
ChartGuru.ChartChannel
Constructors
Section titled “Constructors”
ChartChannel()
Section titled “ChartChannel()”public ChartChannel()Properties
Section titled “Properties”
Binding
Section titled “Binding”public ChartChannelBinding Binding { get; }How the channel is bound.
Returns
ChartGuru.ChartChannelBinding
Literal
Section titled “Literal”public bool Literal { get; set; }True when the bound column holds the visual values themselves, like per-mark .symbolSize,
.symbol(.square) or .foregroundStyle(.red) modifiers in Swift Charts, instead of values mapped
through a scale and shown in the legend. Size reads diameters in points, Symbol reads SymbolShape
names and Color reads HTML colors such as #FF3B30; empty cells keep the layer style. Only the
Size, Symbol and Color channels read it; the Opacity, Rotation and ClipShape channels always read their values
directly.
Returns
System.Boolean
IsBound
Section titled “IsBound”public bool IsBound { get; }True when the channel reads at least one column or has a constant.
Returns
System.Boolean
Column
Section titled “Column”public string Column { get; }The first bound column, or an empty string.
Returns
System.String
Columns
Section titled “Columns”public IReadOnlyList<string> Columns { get; }All bound columns; several columns describe wide data with one series per column.
Returns
System.Collections.Generic.IReadOnlyList{System.String}
Constant
Section titled “Constant”public string Constant { get; }The constant in invariant text.
Returns
System.String
public string Label { get; }The display label, falling back to the first column name.
Returns
System.String
AuthoredLabel
Section titled “AuthoredLabel”public string AuthoredLabel { get; }The explicitly authored label, which may be empty.
Returns
System.String