Histogram
ConsoleMonster.Widgets
Vertical bars for a distribution: values are counted into buckets defined by edges, bars grow with eighth-block precision, the largest count labels the top and bucket labels sit under the bars. Live operation: add (Value).
Inheritance
- LiveWidget
- Histogram
Usage
Explore 25 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 13
- Extension method Histogram.EdgeFormatBy
- Extension method Histogram.Height
- Extension method Histogram.Label
- Extension method Histogram.Labels
- Extension method Histogram.Role
- Extension method Histogram.Unit
- Method Histogram.Add
- Method HistogramFluent.EdgeFormatBy
- Method HistogramFluent.Height
- Method HistogramFluent.Label
- Method HistogramFluent.Labels
- Method HistogramFluent.Role
- Method HistogramFluent.Unit
Accepted by parameters 12
- Extension method Histogram.EdgeFormatBy
- Extension method Histogram.Height
- Extension method Histogram.Label
- Extension method Histogram.Labels
- Extension method Histogram.Role
- Extension method Histogram.Unit
- Method HistogramFluent.EdgeFormatBy
- Method HistogramFluent.Height
- Method HistogramFluent.Label
- Method HistogramFluent.Labels
- Method HistogramFluent.Role
- Method HistogramFluent.Unit
Constructors
public Histogram(IReadOnlyList<double> edges, string widgetId = "histogram") #Creates a histogram.
Parameters
- edges System.Collections.Generic.IReadOnlyList<double>
- Ascending bucket edges; values below the first edge go to the first bucket, values at or above the last edge to the last.
- widgetId string = "histogram"
- The live name (default histogram).
Methods
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 IList<string> Labels { get; } #Optional bucket-edge labels, in edge order; omitted edges retain their numeric labels.
public ThemeToken Role { get; set; } #The bar colour role (default ThemeToken.Series1).
public Func<double, string>? EdgeFormat { get; set; } #Fluent("EdgeFormatBy")Formats the bucket edge labels (for example milliseconds as 250ms and 1s), or null for the compact number and Histogram.Unit.
Inherited Properties
Extension Methods
public static Histogram EdgeFormatBy(Histogram histogram, Func<double, string>? value) #Sets Histogram.EdgeFormat: Formats the bucket edge labels (for example milliseconds as 250ms and 1s), or null for the compact number and Histogram.Unit.
Parameters
- histogram ConsoleMonster.Widgets.Histogram
- The instance.
- value System.Func<double, string>?
- The callback.
Examples
// C# initializer or property // C# fluent
histogram.EdgeFormat = value; histogram.EdgeFormatBy(value);public static Histogram Height(Histogram histogram, int value) #Sets Histogram.Height: Rows for the bars (default 6).
Parameters
- histogram ConsoleMonster.Widgets.Histogram
- The instance.
- value int
- The value.
Examples
// C# initializer or property // C# fluent
histogram.Height = value; histogram.Height(value);public static Histogram Label(Histogram histogram, string item) #Adds an item to Histogram.Labels: Optional bucket-edge labels, in edge order; omitted edges retain their numeric labels.
Parameters
- histogram ConsoleMonster.Widgets.Histogram
- The instance.
- item string
- The item.
public static Histogram Labels(Histogram histogram, IEnumerable<string> items) #Adds items to Histogram.Labels: Optional bucket-edge labels, in edge order; omitted edges retain their numeric labels.
Parameters
- histogram ConsoleMonster.Widgets.Histogram
- The instance.
- items System.Collections.Generic.IEnumerable<string>
- The items, in order.
public static Histogram Role(Histogram histogram, ThemeToken value) #Sets Histogram.Role: The bar colour role (default ThemeToken.Series1).
Parameters
- histogram ConsoleMonster.Widgets.Histogram
- The instance.
- value ConsoleMonster.Styling.ThemeToken
- The value.
Examples
// C# initializer or property // C# fluent
histogram.Role = value; histogram.Role(value);public static Histogram Unit(Histogram histogram, string? value) #Sets Histogram.Unit: A unit for bucket labels (for example s).
Parameters
- histogram ConsoleMonster.Widgets.Histogram
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
histogram.Unit = value; histogram.Unit(value);