ChartLegendItem
ChartForgeX.Core
An immutable legend entry that does not come from a series, such as a reference line, threshold band or annotation.
Inheritance
- object
- ChartLegendItem
Remarks
Custom items follow the series entries. They describe the chart and are never visibility toggles.
Usage
Explore 7 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 6
- Method ChartLegendItem.Band
- Method ChartLegendItem.Line
- Method ChartLegendItem.Marker
- Method ChartLegendItem.WithKeySize
- Property ChartLegendItemContext.Item
- Property ChartLegendOptions.Items
Accepted by parameters 1
- Method Chart.AddLegendItem
Methods
public static ChartLegendItem Band(string label, ChartColor color, double fillOpacity = 0.2) #Creates a filled square key outlined in the item colour, for example for a threshold band or target range.
Parameters
- label string
- The legend label.
- color ChartForgeX.Primitives.ChartColor
- The band colour.
- fillOpacity double = 0.2
- The fill opacity from zero through one; one draws a solid swatch.
Returns
ChartLegendItempublic static ChartLegendItem Line(string label, ChartColor color, IEnumerable<double>? dash = null, double strokeWidth = 2) #Creates a line key, for example for a target or reference line.
Parameters
- label string
- The legend label.
- color ChartForgeX.Primitives.ChartColor
- The line colour.
- dash System.Collections.Generic.IEnumerable<double>? = null
- Optional dash and gap lengths from 0.25 through 1024 chart pixels; null or empty draws a solid line. ChartLegendItem.ReferenceDash matches chart reference lines.
- strokeWidth double = 2
- The line width, greater than zero and at most eight chart pixels.
Returns
ChartLegendItempublic static ChartLegendItem Marker(string label, ChartColor color, ChartMarkerShape shape = Circle) #Creates a marker key, for example for an annotation or event marker.
Parameters
- label string
- The legend label.
- color ChartForgeX.Primitives.ChartColor
- The marker colour.
- shape ChartForgeX.Core.ChartMarkerShape = Circle
- The marker shape.
Returns
ChartLegendItempublic ChartLegendItem WithKeySize(double size) #Returns a copy of this item with its own key size.
Parameters
- size double
- The key size from 4 through 24 chart pixels.
Returns
ChartLegendItemInherited Methods
Properties
public static IReadOnlyList<double> ReferenceDash { get; } #Gets the dash and gap lengths chart reference lines use by default.
public ChartLegendKeyShape Key { get; } #Gets the key shape: ChartLegendKeyShape.Line, ChartLegendKeyShape.Square or ChartLegendKeyShape.Marker.
public ChartMarkerShape MarkerShape { get; } #Gets the marker shape drawn by a ChartLegendKeyShape.Marker key.
public IReadOnlyList<double>? Dash { get; } #Gets the dash and gap lengths of a line key, or null for a solid line.
public double StrokeWidth { get; } #Gets the stroke width of a line key, or of a band key's outline.
public double? KeySize { get; } #Gets the key size in chart pixels, or null to use the legend's key size.