Skip to main content
twblazor
Home
  • Get started
  • Tailwind with Blazor
  • Why twblazor?
  • Theme
  • Class Merge
    • Configuring localization
    • RTL Provider
  • Breadcrumb
  • Card
  • Carousel
  • Collapse
  • Context Menu
  • Drawer
  • Footer
  • Menu
  • Navbar
  • On This Page
  • Separator
  • Sidebar
  • Stepper
  • Tabs
  • Tree List
  • Container
  • Flex
  • Grid
  • Text
  • Link
  • Button
  • Form
    • AutocompleteNew
    • Checkbox
    • Color Picker
    • Date Picker
    • Date Range Picker
    • Datetime Picker
    • Datetime Range Picker
    • File Upload
    • Input GroupNew
    • NumericNew
    • Masked InputNew
    • Radio Button
    • Range SliderNew
    • RatingNew
    • Select
    • Slider
    • Switch
    • Tag InputNew
    • Text EditorNew
    • Textfield
    • Time Picker
    • Time Range Picker
  • Toggle
  • Toggle Group
  • Alert
  • Avatar
  • Badge
  • Chip
  • Empty
  • Icon
  • Popover
  • Progress
  • Skeleton
  • Spinner
  • Tooltip
  • Data Table
  • SpreadsheetNew
  • Column Filter Editor
  • Pagination
  • Pick List
  • Barcode
  • QR Code
  • Calendar
  • Table
  • Attachment
  • Overview
    • Bar
    • Bullet
    • Column
    • Dot Plot
    • Dumbbell
    • Icon
    • Lollipop
    • Radial Bar
    • Range
    • Word Cloud
    • Area
    • Bump
    • Bump Area
    • Candlestick
    • Gantt
    • Horizon
    • Line
    • Slope
    • Small Multiples
    • Stream Graph
    • Funnel
    • Gauge
    • Marimekko
    • Nightingale
    • Pie
    • Treemap
    • Waffle
    • Waterfall
    • Circular Treemap
    • Convex Treemap
    • Dendrogram
    • Sunburst
    • Barcode
    • Beeswarm
    • Box Plot
    • Density Plot
    • Histogram
    • Radial Histogram
    • Ridgeline
    • Strip Plot
    • Violin Plot
    • Categorical Scatter
    • Contour
    • Hexagonal Binning
    • Quadrant
    • Scatter
    • Heatmap
    • Matrix
    • Parallel Coordinates
    • Radar
    • Arc Diagram
    • Chord Diagram
    • Flowchart
    • Network Diagram
    • Sankey
    • Euler Diagram
    • Venn Diagram
  • Bubble
  • Marker
  • Message
  • Dialog Service
  • Toast Service
API DocumentationAI Agents & Skills
Home Get Started

Charts

TwViolinPlotChart

TwViolinPlotChart is a Blazor violin plot that shows the full shape of each group's distribution with its median and middle half marked.

Last updated 23 October 2026

Basic usage

TwViolinPlotChart draws a mirrored density curve for each ChartSample: wide where values cluster, narrow where they are rare. The bar down the middle spans the middle half of the values and the dot marks the median.
Exam scores by classPercent
20406080100
20406080100
Class ACount 13Minimum 48Lower quartile 61Median 66Upper quartile 71Maximum 85
Class BCount 13Minimum 52Lower quartile 70Median 75Upper quartile 80Maximum 94
Class CCount 11Minimum 35Lower quartile 54Median 68Upper quartile 79.5Maximum 90
Class AClass BClass C
RAZOR
<TwChart Title="Exam scores by class" Description="Percent">
    <TwViolinPlotChart Samples="@_classes" />
</TwChart>
CSHARP
@code {
    private readonly ChartSample[] _classes =
    [
        new("Class A", [48, 55, 58, 61, 63, 64, 66, 67, 69, 71, 74, 78, 85]),
        new("Class B", [52, 60, 66, 70, 72, 74, 75, 76, 78, 80, 83, 88, 94]),
        new("Class C", [35, 42, 51, 57, 62, 68, 71, 77, 82, 86, 90])
    ];
}

Shapes a box plot hides

These two teams have almost the same median and quartiles, so their box plots would look alike. The violins show that one is evenly spread while the other splits into a fast group and a slow group.
Ticket resolution timeHours
0 h5 h10 h15 h20 h25 h
0 h5 h10 h15 h20 h25 h
Evenly spreadCount 12Minimum 2 hLower quartile 8 hMedian 13 hUpper quartile 19 hMaximum 24 h
Two groupsCount 12Minimum 2 hLower quartile 4 hMedian 13 hUpper quartile 21 hMaximum 24 h
Evenly spreadTwo groups
RAZOR
<TwChart Title="Ticket resolution time" Description="Hours">
    <TwViolinPlotChart Samples="@_teams" LabelHeader="Team" ValueFormat="0 h" />
</TwChart>
CSHARP
@code {
    private readonly ChartSample[] _teams =
    [
        new("Evenly spread", [2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24]),
        new("Two groups", [2, 3, 3, 4, 4, 5, 20, 21, 21, 22, 23, 24])
    ];
}

Horizontal

Set Horizontal to list the groups down the side, which suits long names and many groups.
Exam scores by class
Class AClass BClass C
Class AClass BClass C
Class ACount 13Minimum 48Lower quartile 61Median 66Upper quartile 71Maximum 85
Class BCount 13Minimum 52Lower quartile 70Median 75Upper quartile 80Maximum 94
Class CCount 11Minimum 35Lower quartile 54Median 68Upper quartile 79.5Maximum 90
20406080100
RAZOR
<TwChart Title="Exam scores by class">
    <TwViolinPlotChart Samples="@_classes" Horizontal="true" />
</TwChart>

When to use

Use a violin plot when the shape of each distribution matters. Each violin is drawn to the full width of its slot and ends at the group's lowest and highest values, so compare the shapes, not the widths. For a plain summary use TwBoxPlotChart.

Summary

Tooltips and the table view give the count, minimum, lower quartile, median, upper quartile and maximum of each group.

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
  • Shapes a box plot hides
  • Horizontal
  • When to use
  • Summary
  • Shared features
  • Keyboard navigation
twblazor

The Tailwind CSS component library for Blazor. Accessible, themeable and MIT licensed.

Discord (opens in a new tab) GitHub(opens in a new tab)

Get started

  • Install guide
  • Theming
  • Class merging
  • Localization

Guides

  • Tailwind CSS with Blazor
  • Why twblazor?
  • Right to left
  • AI agents and skills

Resources

  • API documentation (opens in a new tab)
  • llms.txt (opens in a new tab)
  • MIT License (opens in a new tab)

Community

  • Contributing (opens in a new tab)
  • Code of conduct (opens in a new tab)
  • Report an issue (opens in a new tab)

twblazor is and always will be free and open source.

An unhandled error has occurred. Reload