Charts
TwLineChart
TwLineChart is a Blazor line chart for trends. Supports straight, smooth (spline) and step lines, markers and gaps for missing values.
Last updated
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
TwLineChart joins values in category order to show a trend. Hover or focus anywhere in a category and one tooltip lists every series at that point, so the pointer never has to land on a line.Spline
Set
Curve to ChartCurve.Smooth for a smooth curve through the points. The curve never overshoots the data, so it cannot suggest a peak that is not there.RAZOR
<TwChart Title="Monthly visitors">
<TwLineChart Categories="@_months" Series="@_visitors" Curve="ChartCurve.Smooth" />
</TwChart>Step line
ChartCurve.Step holds each value until the next one, which suits values that change at discrete moments such as a price or a stock level.Markers
A dot is drawn at each point when there are twelve categories or fewer. Set
ShowMarkers to force them on or off.RAZOR
<TwChart Title="Monthly visitors">
<TwLineChart Categories="@_months" Series="@_visitors" ShowMarkers="false" />
</TwChart>Missing values
A
null value breaks the line instead of dropping to zero, so a gap in the data looks like a gap.Summary
Tooltips and the table view give the value of every series for each category.