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

TwContourChart

TwContourChart is a Blazor contour plot that joins the places where a measured surface has the same value, like height lines on a map.

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

TwContourChart draws contour lines over a surface estimated from scattered samples. Give each ChartPoint its position as X and Y and its measurement as Size. A stronger line marks a higher value, and each sample is drawn as a dot.
Room temperatureDegrees Celsius across the floor, metres from the corner
North
0246
0246
18.6719.832122.1723.33
SensorsEast 0North 0Temperature 17.5
SensorsEast 4North 0Temperature 18.2
SensorsEast 8North 0Temperature 19.1
SensorsEast 0North 3Temperature 18.4
SensorsEast 4North 3Temperature 20.6
SensorsEast 8North 3Temperature 22.3
SensorsEast 0North 6Temperature 19
SensorsEast 4North 6Temperature 21.8
SensorsEast 8North 6Temperature 24.5
02468
East
RAZOR
<TwChart Title="Room temperature" Description="Degrees Celsius across the floor, metres from the corner">
    <TwContourChart Series="@_temperatures" XTitle="East" YTitle="North" ValueTitle="Temperature" />
</TwChart>
CSHARP
@code {
    private readonly ChartPointSeries[] _temperatures =
    [
        new("Sensors",
        [
            new(0, 0, Size: 17.5), new(4, 0, Size: 18.2), new(8, 0, Size: 19.1),
            new(0, 3, Size: 18.4), new(4, 3, Size: 20.6), new(8, 3, Size: 22.3),
            new(0, 6, Size: 19.0), new(4, 6, Size: 21.8), new(8, 6, Size: 24.5)
        ])
    ];
}

Levels

Levels sets how many lines are drawn, from 2 to 10, spaced evenly between the lowest and highest measurement. More lines show the slope in more detail: where they bunch together the surface is steep.
Three levels
North
0246
0246
19.252122.75
SensorsEast 0North 0Value 17.5
SensorsEast 4North 0Value 18.2
SensorsEast 8North 0Value 19.1
SensorsEast 0North 3Value 18.4
SensorsEast 4North 3Value 20.6
SensorsEast 8North 3Value 22.3
SensorsEast 0North 6Value 19
SensorsEast 4North 6Value 21.8
SensorsEast 8North 6Value 24.5
02468
East
Nine levels
North
0246
0246
18.218.919.620.32121.722.423.123.8
SensorsEast 0North 0Value 17.5
SensorsEast 4North 0Value 18.2
SensorsEast 8North 0Value 19.1
SensorsEast 0North 3Value 18.4
SensorsEast 4North 3Value 20.6
SensorsEast 8North 3Value 22.3
SensorsEast 0North 6Value 19
SensorsEast 4North 6Value 21.8
SensorsEast 8North 6Value 24.5
02468
East
RAZOR
<div class="grid gap-8 md:grid-cols-2">
    <TwChart Title="Three levels">
        <TwContourChart Series="@_temperatures" Levels="3" XTitle="East" YTitle="North" Height="ChartHeight.Small" />
    </TwChart>
    <TwChart Title="Nine levels">
        <TwContourChart Series="@_temperatures" Levels="9" XTitle="East" YTitle="North" Height="ChartHeight.Small" />
    </TwChart>
</div>

Two peaks

Closed rings mark a peak or a hollow. This survey has two hills with a saddle between them. Name the samples with Label to title their tooltips.
Signal strengthDecibels across the site, with the two transmitters named
Y
01234
01234
1218.825.732.639.446.353.1
North mastX 2Y 3Signal 60
South mastX 8Y 1.5Signal 52
SurveyX 0Y 0Signal 5.1
SurveyX 1.6Y 0Signal 7.1
SurveyX 3.2Y 0Signal 7.2
SurveyX 4.8Y 0Signal 7.2
SurveyX 6.4Y 0Signal 11
SurveyX 8Y 0Signal 17.3
SurveyX 9.6Y 0Signal 9.8
SurveyX 0Y 1Signal 7.5
SurveyX 1.6Y 1Signal 12.9
SurveyX 3.2Y 1Signal 11.5
SurveyX 4.8Y 1Signal 9.2
SurveyX 6.4Y 1Signal 16.1
SurveyX 8Y 1Signal 43.1
SurveyX 9.6Y 1Signal 14.6
SurveyX 0Y 2Signal 10.8
SurveyX 1.6Y 2Signal 29
SurveyX 3.2Y 2Signal 19.6
SurveyX 4.8Y 2Signal 10.6
SurveyX 6.4Y 2Signal 16.5
SurveyX 8Y 2Signal 43.2
SurveyX 9.6Y 2Signal 14.7
SurveyX 0Y 3Signal 12.8
SurveyX 1.6Y 3Signal 52.9
SurveyX 3.2Y 3Signal 26.6
SurveyX 4.8Y 3Signal 10.6
SurveyX 6.4Y 3Signal 11.9
SurveyX 8Y 3Signal 17.6
SurveyX 9.6Y 3Signal 10
SurveyX 0Y 4Signal 10.7
SurveyX 1.6Y 4Signal 28.9
SurveyX 3.2Y 4Signal 19.2
SurveyX 4.8Y 4Signal 9.1
SurveyX 6.4Y 4Signal 8.1
SurveyX 8Y 4Signal 8.8
SurveyX 9.6Y 4Signal 6.3
0246810
X
RAZOR
<TwChart Title="Signal strength" Description="Decibels across the site, with the two transmitters named">
    <TwContourChart Series="@_signal" Levels="7" XTitle="X" YTitle="Y" ValueTitle="Signal" ValueFormat="0.#" Height="ChartHeight.Large" />
</TwChart>
CSHARP
@code {
    // A 7 by 5 grid of readings that fall away from two transmitters.
    private readonly ChartPointSeries[] _signal =
    [
        new("Transmitters", [new(2, 3, "North mast", 60), new(8, 1.5, "South mast", 52)]),
        new("Survey", [.. Enumerable.Range(0, 35).Select(index =>
        {
            var (x, y) = (index % 7 * 1.6, index / 7 * 1.0);
            var north = 60 / (1 + Math.Pow(x - 2, 2) + Math.Pow(y - 3, 2));
            var south = 52 / (1 + Math.Pow(x - 8, 2) + Math.Pow(y - 1.5, 2));
            return new ChartPoint(x, y, Size: Math.Round(north + south, 1));
        })])
    ];
}

When to use

Use a contour plot for a measurement that varies smoothly across two dimensions. The surface between samples is estimated, so the lines are a guide and the dots are the measurements. Points without a Size are left out, and at least three samples are needed.

Summary

Tooltips and the table view give the position and the value of each sample.

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
  • Levels
  • Two peaks
  • When to use
  • 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