ScatterPlot
ConsoleMonster.Widgets
Points placed by two values, such as the time each item of a run took against the order it finished in. With colour, points are braille dots (2x4 per cell) on Full, half blocks on Basic and characters on Ascii, each in its own role, so a status role shows which points failed. Without colour, a point with a status role shows that status symbol and other points *. An accessible profile lists the values as text instead: problem points one by one, the others as a count and range. The y axis carries its top and bottom values; ScatterPlot.StartLabel and ScatterPlot.EndLabel name the ends of the x axis. Live operation: add (Value = y, Key = x or empty for the next position, State = an optional status word for the role).
Inheritance
- LiveWidget
- ScatterPlot
Usage
Explore 38 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 20
- Extension method ScatterPlot.Capacity
- Extension method ScatterPlot.EndLabel
- Extension method ScatterPlot.Height
- Extension method ScatterPlot.Maximum
- Extension method ScatterPlot.Minimum
- Extension method ScatterPlot.Role
- Extension method ScatterPlot.StartLabel
- Extension method ScatterPlot.Unit
- Extension method ScatterPlot.ValueFormatBy
- Method ScatterPlot.Add
- Method ScatterPlot.Clear
- Method ScatterPlotFluent.Capacity
- Method ScatterPlotFluent.EndLabel
- Method ScatterPlotFluent.Height
- Method ScatterPlotFluent.Maximum
- Method ScatterPlotFluent.Minimum
- Method ScatterPlotFluent.Role
- Method ScatterPlotFluent.StartLabel
- Method ScatterPlotFluent.Unit
- Method ScatterPlotFluent.ValueFormatBy
Accepted by parameters 18
- Extension method ScatterPlot.Capacity
- Extension method ScatterPlot.EndLabel
- Extension method ScatterPlot.Height
- Extension method ScatterPlot.Maximum
- Extension method ScatterPlot.Minimum
- Extension method ScatterPlot.Role
- Extension method ScatterPlot.StartLabel
- Extension method ScatterPlot.Unit
- Extension method ScatterPlot.ValueFormatBy
- Method ScatterPlotFluent.Capacity
- Method ScatterPlotFluent.EndLabel
- Method ScatterPlotFluent.Height
- Method ScatterPlotFluent.Maximum
- Method ScatterPlotFluent.Minimum
- Method ScatterPlotFluent.Role
- Method ScatterPlotFluent.StartLabel
- Method ScatterPlotFluent.Unit
- Method ScatterPlotFluent.ValueFormatBy
Constructors
public ScatterPlot(string widgetId = "scatter") #Creates a scatter plot.
Parameters
- widgetId string = "scatter"
- The live name (default scatter).
Methods
public ScatterPlot Add(double x, double y, ThemeToken? role = null) #Adds a point.
Parameters
- x double
- The horizontal value.
- y double
- The vertical value.
- role ConsoleMonster.Styling.ThemeToken? = null
- The colour role, or null for ScatterPlot.Role.
public override void Apply(LiveEvent liveEvent) #Applies an event to the widget's state.
Parameters
- liveEvent ConsoleMonster.Live.LiveEvent
- The event.
public SparklineHandle Handle(ILiveDispatcher dispatcher) #Returns a handle that adds values through a dispatcher.
Parameters
- dispatcher ConsoleMonster.Live.ILiveDispatcher
- The dispatcher.
public override Size Measure(Constraints constraints, RenderContext context) #Returns the size the widget wants within the constraints.
Parameters
- constraints ConsoleMonster.Layout.Constraints
- The space offered.
- context ConsoleMonster.Canvas.RenderContext
- Profile, theme and glyphs.
public override void Render(Region region, RenderContext context) #Renders 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) #Parameters
- liveEvent LiveEvent
Returns
string?Properties
public int Height { get; set; } #Rows for the plot, its x axis and the axis labels (default 8).
public int Capacity { get; set; } #How many points the plot keeps; the oldest are dropped past it (default 4096).
public ThemeToken Role { get; set; } #The colour role of points without their own (default ThemeToken.Series1).
public double? Minimum { get; set; } #A fixed minimum for the y axis, or null (0 when all values are positive).
public double? Maximum { get; set; } #A fixed maximum for the y axis, or null for the largest value.
public string? Unit { get; set; } #A unit appended to the y axis values (for example s).
public Func<double, string>? ValueFormat { get; set; } #Fluent("ValueFormatBy")Formats the y axis values (for example seconds as 1m 05s), or null for the compact number and ScatterPlot.Unit.
public string? StartLabel { get; set; } #The literal label under the left end of the x axis (for example "first"), or null for none.
public string? EndLabel { get; set; } #The literal label under the right end of the x axis (for example "now"), or null for none.
Inherited Properties
Extension Methods
public static ScatterPlot Capacity(ScatterPlot scatterPlot, int value) #Sets ScatterPlot.Capacity: How many points the plot keeps; the oldest are dropped past it (default 4096).
Parameters
- scatterPlot ConsoleMonster.Widgets.ScatterPlot
- The instance.
- value int
- The value.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Widgets.ScatterPlot { Capacity = value }; scatterPlot.Capacity(value);public static ScatterPlot EndLabel(ScatterPlot scatterPlot, string? value) #Sets ScatterPlot.EndLabel: The literal label under the right end of the x axis (for example "now"), or null for none.
Parameters
- scatterPlot ConsoleMonster.Widgets.ScatterPlot
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Widgets.ScatterPlot { EndLabel = value }; scatterPlot.EndLabel(value);public static ScatterPlot Height(ScatterPlot scatterPlot, int value) #Sets ScatterPlot.Height: Rows for the plot, its x axis and the axis labels (default 8).
Parameters
- scatterPlot ConsoleMonster.Widgets.ScatterPlot
- The instance.
- value int
- The value.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Widgets.ScatterPlot { Height = value }; scatterPlot.Height(value);public static ScatterPlot Maximum(ScatterPlot scatterPlot, double? value) #Sets ScatterPlot.Maximum: A fixed maximum for the y axis, or null for the largest value.
Parameters
- scatterPlot ConsoleMonster.Widgets.ScatterPlot
- The instance.
- value double?
- The value.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Widgets.ScatterPlot { Maximum = value }; scatterPlot.Maximum(value);public static ScatterPlot Minimum(ScatterPlot scatterPlot, double? value) #Sets ScatterPlot.Minimum: A fixed minimum for the y axis, or null (0 when all values are positive).
Parameters
- scatterPlot ConsoleMonster.Widgets.ScatterPlot
- The instance.
- value double?
- The value.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Widgets.ScatterPlot { Minimum = value }; scatterPlot.Minimum(value);public static ScatterPlot Role(ScatterPlot scatterPlot, ThemeToken value) #Sets ScatterPlot.Role: The colour role of points without their own (default ThemeToken.Series1).
Parameters
- scatterPlot ConsoleMonster.Widgets.ScatterPlot
- The instance.
- value ConsoleMonster.Styling.ThemeToken
- The value.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Widgets.ScatterPlot { Role = value }; scatterPlot.Role(value);public static ScatterPlot StartLabel(ScatterPlot scatterPlot, string? value) #Sets ScatterPlot.StartLabel: The literal label under the left end of the x axis (for example "first"), or null for none.
Parameters
- scatterPlot ConsoleMonster.Widgets.ScatterPlot
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Widgets.ScatterPlot { StartLabel = value }; scatterPlot.StartLabel(value);public static ScatterPlot Unit(ScatterPlot scatterPlot, string? value) #Sets ScatterPlot.Unit: A unit appended to the y axis values (for example s).
Parameters
- scatterPlot ConsoleMonster.Widgets.ScatterPlot
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Widgets.ScatterPlot { Unit = value }; scatterPlot.Unit(value);public static ScatterPlot ValueFormatBy(ScatterPlot scatterPlot, Func<double, string>? value) #Sets ScatterPlot.ValueFormat: Formats the y axis values (for example seconds as 1m 05s), or null for the compact number and ScatterPlot.Unit.
Parameters
- scatterPlot ConsoleMonster.Widgets.ScatterPlot
- The instance.
- value System.Func<double, string>?
- The callback.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Widgets.ScatterPlot { ValueFormat = value }; scatterPlot.ValueFormatBy(value);