Skip to main content
twblazor
Home
  • Get started
  • Tailwind with Blazor
  • Why twblazor?
  • Theme
  • Class Merge
    • Configuring localization
    • RTL Provider
  • Breadcrumb
  • Card
  • Carousel
  • Collapse
  • Footer
  • MenuNew
  • Navbar
  • On This PageNew
  • Sidebar
  • Stepper
  • Tabs
  • Tree List
  • Button
  • Checkbox
  • Color Picker
    • Date
    • Date Range
    • Datetime
    • Datetime Range
    • Time
    • Time Range
  • File Upload
  • NumericNew
  • Radio Button
  • RatingNew
  • Select
  • Slider
  • Switch
  • Textfield
  • Alert
  • Avatar
  • Chip
  • Icon
  • Progress
  • Skeleton
  • Spinner
  • TooltipNew
  • Data Table
  • Pagination
  • Pick List
  • BarcodeNew
  • QR CodeNew
  • CalendarNew
  • Table
  • Overview
  • Area
  • Bar
  • Box Plot
  • Bullet
  • Bump
  • Candlestick
  • Column
  • Dot Plot
  • Dumbbell
  • Funnel
  • Gantt
  • Gauge
  • Heatmap
  • Histogram
  • Icon
  • Line
  • Lollipop
  • Matrix
  • Nightingale
  • Parallel Coordinates
  • Pie
  • Quadrant
  • Radar
  • Radial Bar
  • Range
  • Scatter
  • Slope
  • Small Multiples
  • Strip Plot
  • Treemap
  • Waffle
  • Waterfall
  • Arc Diagram
  • Barcode
  • Beeswarm
  • Bump Area
  • Categorical Scatter
  • Chord Diagram
  • Circular Treemap
  • Contour
  • Convex Treemap
  • Density Plot
  • Dendrogram
  • Euler Diagram
  • Flowchart
  • Hexagonal Binning
  • Horizon
  • Marimekko
  • Network Diagram
  • Radial Histogram
  • Ridgeline
  • Sankey
  • Stream Graph
  • Sunburst
  • Venn Diagram
  • Violin Plot
  • Word Cloud
  • Dialog Service
  • Toast Service
API DocumentationAI Agents & Skills
Home Get Started

Charts

TwHistogramChart

TwHistogramChart is a Blazor histogram that groups raw values into equal-width bins to reveal the shape of a distribution.

Last updated 18 October 2026

Please be aware this component is new, may have bugs and/or be subject to change. Please report any bugs at https://github.com/twblazor/twblazor/issues.

Basic usage

TwHistogramChart takes raw Values, groups them into equal-width bins and draws a column per bin showing how many values fall in it. You pass the observations; the chart does the counting.
Response timesMilliseconds
Count
051015
051015
112 to 141.67Count 5
141.67 to 171.33Count 11
171.33 to 201Count 6
201 to 230.67Count 3
230.67 to 260.33Count 1
260.33 to 290Count 2
112141.67171.33201230.67260.33290
RAZOR
<TwChart Title="Response times" Description="Milliseconds">
    <TwHistogramChart Values="@_responseTimes" />
</TwChart>
CSHARP
@code {
    private readonly double[] _responseTimes =
    [
        112, 120, 131, 135, 138, 142, 144, 149, 151, 153, 156, 158, 160, 163, 167,
        170, 172, 176, 181, 185, 190, 196, 204, 215, 228, 240, 262, 290
    ];
}

Bin count

The number of bins follows Sturges' rule unless you set BinCount. Fewer bins show the overall shape; more show detail.
Response times
Count
0246
0246
112 to 126.83Count 2
126.83 to 141.67Count 3
141.67 to 156.5Count 6
156.5 to 171.33Count 5
171.33 to 186.17Count 4
186.17 to 201Count 2
201 to 215.83Count 2
215.83 to 230.67Count 1
230.67 to 245.5Count 1
245.5 to 260.33Count 0
260.33 to 275.17Count 1
275.17 to 290Count 1
112141.67171.33201230.67260.33290
RAZOR
<TwChart Title="Response times">
    <TwHistogramChart Values="@_responseTimes" BinCount="12" />
</TwChart>

Labels

RangeLabel and CountLabel name the two columns of the table view, and CountLabel also titles the axis.
Response times
Requests
051015
051015
112 to 141.67Requests 5
141.67 to 171.33Requests 11
171.33 to 201Requests 6
201 to 230.67Requests 3
230.67 to 260.33Requests 1
260.33 to 290Requests 2
112141.67171.33201230.67260.33290
RAZOR
<TwChart Title="Response times">
    <TwHistogramChart Values="@_responseTimes" BinCount="6" RangeLabel="Milliseconds" CountLabel="Requests" Height="ChartHeight.Small" />
</TwChart>

Summary

Tooltips and the table view give the range and count of each bin.

Shared features

The legend, tooltips, keyboard navigation, table view, value formatting, height and empty state work the same on every chart. See TwChart for those options.

Keyboard navigation

The plot is a single Tab stop. Each data point is announced with its series and value as focus reaches it, and the table view presents the same data without the plot.
Key What it does
Tab Moves focus into the plot, onto the data point last visited.
Arrow Right or Arrow Down Moves to the next data point.
Arrow Left or Arrow Up Moves to the previous data point.
Home or End Moves to the first or last data point.
Escape Hides the tooltip of the focused data point.
Enter or Space On a legend item: shows or hides that series. On the table button: switches between the chart and its data table.

On this page

  • Basic usage
  • Bin count
  • Labels
  • Summary
  • Shared features
  • Keyboard navigation
Discord (opens in a new tab) • GitHub (opens in a new tab) • Documentation (opens in a new tab) • MIT License (opens in a new tab) • llms.txt (opens in a new tab)

twblazor is and always will be free and open source.

An unhandled error has occurred. Reload