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

TwSlopeChart

TwSlopeChart is a Blazor slope chart: a labelled line per series between two points in time, showing the direction and size of each change.

Last updated 23 October 2026

Basic usage

TwSlopeChart draws a straight line per series between two points in time and labels both ends, so the direction and size of each change is read from the slope. Use two categories for the classic form.
Market sharePercent
Aster 3441
Birch 2819
Cedar 1526
Aster2020 34
Aster2025 41
Birch2020 28
Birch2025 19
Cedar2020 15
Cedar2025 26
20202025
RAZOR
<TwChart Title="Market share" Description="Percent">
    <TwSlopeChart Categories="@_years" Series="@_share" />
</TwChart>
CSHARP
@code {
    private readonly string[] _years = ["2020", "2025"];
    
    private readonly ChartSeries[] _share =
    [
        new("Aster", [34, 41]),
        new("Birch", [28, 19]),
        new("Cedar", [15, 26])
    ];
}

More than two points

Extra categories add intermediate points. The first is labelled with the series name and value, and the last with its value.
Market share
Aster 2241
Birch 3719
Cedar 926
Aster2015 22
Aster2020 34
Aster2025 41
Birch2015 37
Birch2020 28
Birch2025 19
Cedar2015 9
Cedar2020 15
Cedar2025 26
201520202025
RAZOR
<TwChart Title="Market share">
    <TwSlopeChart Categories="@_threeYears" Series="@_shareByYear" />
</TwChart>
CSHARP
@code {
    private readonly string[] _threeYears = ["2015", "2020", "2025"];
    
    private readonly ChartSeries[] _shareByYear =
    [
        new("Aster", [22, 34, 41]),
        new("Birch", [37, 28, 19]),
        new("Cedar", [9, 15, 26])
    ];
}

Formatting

ValueFormat applies to the end labels as well as the tooltips and table view.
Market share
Aster 34%41%
Birch 28%19%
Cedar 15%26%
Aster2020 34%
Aster2025 41%
Birch2020 28%
Birch2025 19%
Cedar2020 15%
Cedar2025 26%
20202025
RAZOR
<TwChart Title="Market share">
    <TwSlopeChart Categories="@_years" Series="@_share" ValueFormat="0\%" />
</TwChart>

Summary

Tooltips and the table view give the value of every series for each category.

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
  • More than two points
  • Formatting
  • 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