API Reference
Sparkline
A compact trend of recent values: ▁▂▄▆█▇▅ on Full, shades on Basic, an ASCII ramp on Ascii. With Sparkline.Height above 1 it becomes a small area chart. The newest value is on the right and can be shown as a number. Live operation: add (Value).
Inheritance
- LiveWidget
- Sparkline
Usage
Explore 31 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 17
- Method Ui.Sparkline
- Extension method Sparkline.WithCapacity
- Extension method Sparkline.WithHeight
- Extension method Sparkline.WithLabel
- Extension method Sparkline.WithMax
- Extension method Sparkline.WithShowLatest
- Extension method Sparkline.WithToken
- Extension method Sparkline.WithUnit
- Method Sparkline.Add
- Method Sparkline.AddRange
- Method SparklineFluent.WithCapacity
- Method SparklineFluent.WithHeight
- Method SparklineFluent.WithLabel
- Method SparklineFluent.WithMax
- Method SparklineFluent.WithShowLatest
- Method SparklineFluent.WithToken
- Method SparklineFluent.WithUnit
Accepted by parameters 14
- Extension method Sparkline.WithCapacity
- Extension method Sparkline.WithHeight
- Extension method Sparkline.WithLabel
- Extension method Sparkline.WithMax
- Extension method Sparkline.WithShowLatest
- Extension method Sparkline.WithToken
- Extension method Sparkline.WithUnit
- Method SparklineFluent.WithCapacity
- Method SparklineFluent.WithHeight
- Method SparklineFluent.WithLabel
- Method SparklineFluent.WithMax
- Method SparklineFluent.WithShowLatest
- Method SparklineFluent.WithToken
- Method SparklineFluent.WithUnit
Constructors
public Sparkline(String name = "sparkline") #Creates a sparkline.
Parameters
- name System.String = "sparkline"
- The live name (default sparkline).
Methods
public Sparkline Add(Double value) #SparklineAppends a value.
Parameters
- value System.Double
- The value.
Returns
This instance.
public Sparkline AddRange(IEnumerable<Double> values) #SparklineAppends several values.
Parameters
- values System.Collections.Generic.IEnumerable<System.Double>
- The values.
Returns
This instance.
public override Void Apply(LiveEvent liveEvent) #VoidApplies an event to the widget's state.
Parameters
- liveEvent ConsoleMonster.Live.LiveEvent
- The event.
public SparklineHandle Handle(ILiveDispatcher dispatcher) #SparklineHandleReturns a handle that appends values through a dispatcher.
Parameters
- dispatcher ConsoleMonster.Live.ILiveDispatcher
- The dispatcher.
Returns
The handle.
public override Size Measure(Constraints constraints, RenderContext context) #SizeReturns the size the widget wants within the constraints.
Parameters
- constraints ConsoleMonster.Layout.Constraints
- The space offered.
- context ConsoleMonster.Canvas.RenderContext
- Profile, theme and glyphs.
Returns
The desired size, never larger than the constraints.
public override Void Render(Region region, RenderContext context) #VoidRenders into a region. The region may be smaller or larger than the measured size.
Parameters
- region ConsoleMonster.Canvas.Region
- The target region.
- context ConsoleMonster.Canvas.RenderContext
- Profile, theme and glyphs.
Inherited Methods
public virtual String? Describe(LiveEvent liveEvent) #String?Parameters
- liveEvent LiveEvent
public virtual Boolean Equals(Object? obj) #BooleanParameters
- obj Object?
Properties
Inherited Properties
Extension Methods
public static Sparkline WithCapacity(Sparkline sparkline, Int32 value) #SparklineSets Sparkline.Capacity: How many values are kept (default 1024).
Parameters
- sparkline ConsoleMonster.Widgets.Sparkline
- The instance.
- value System.Int32
- The value.
Returns
The same instance.
public static Sparkline WithHeight(Sparkline sparkline, Int32 value) #SparklineSets Sparkline.Height: Rows (default 1).
Parameters
- sparkline ConsoleMonster.Widgets.Sparkline
- The instance.
- value System.Int32
- The value.
Returns
The same instance.
public static Sparkline WithLabel(Sparkline sparkline, String? value) #SparklineSets Sparkline.Label: A label shown on the left (markup), or null.
Parameters
- sparkline ConsoleMonster.Widgets.Sparkline
- The instance.
- value System.String?
- The value.
Returns
The same instance.
public static Sparkline WithMax(Sparkline sparkline, Double? value) #SparklineSets Sparkline.Max: A fixed maximum, or null to scale to the visible values.
Parameters
- sparkline ConsoleMonster.Widgets.Sparkline
- The instance.
- value System.Double?
- The value.
Returns
The same instance.
public static Sparkline WithShowLatest(Sparkline sparkline, Boolean value = true) #SparklineSets Sparkline.ShowLatest: Whether the latest value is shown on the right (default true).
Parameters
- sparkline ConsoleMonster.Widgets.Sparkline
- The instance.
- value System.Boolean = true
- The value (default true).
Returns
The same instance.
public static Sparkline WithToken(Sparkline sparkline, ThemeToken value) #SparklineSets Sparkline.Token: The colour token (default ThemeToken.Accent).
Parameters
- sparkline ConsoleMonster.Widgets.Sparkline
- The instance.
- value ConsoleMonster.Styling.ThemeToken
- The value.
Returns
The same instance.
public static Sparkline WithUnit(Sparkline sparkline, String? value) #SparklineSets Sparkline.Unit: A unit appended to the latest value.
Parameters
- sparkline ConsoleMonster.Widgets.Sparkline
- The instance.
- value System.String?
- The value.
Returns
The same instance.