DwsGauge
The DwsGauge component renders a themed circular/arc gauge (half, quarter, three-quarter or full sweep), a multi-ring "onion" gauge, or a horizontal / vertical linear gauge, with ticks, ranges, a legend, tooltips, animation, and draggable pointers.
API ReferenceSweep Types
The same Circular gauge in each sweep preset.
Show Code
Gauge.razor
<DwsGauge Name='GaugeDemo_Half' Title='Half' Value='62' SweepType='DwsGaugeSweepType.Half' />
<DwsGauge Name='GaugeDemo_Quarter' Title='Quarter' Value='30' SweepType='DwsGaugeSweepType.Quarter' />
<DwsGauge Name='GaugeDemo_ThreeQuarter' Title='Three Quarter' Value='80' SweepType='DwsGaugeSweepType.ThreeQuarter' />
<DwsGauge Name='GaugeDemo_Full' Title='Full' Value='45' SweepType='DwsGaugeSweepType.Full' />Colors, Ticks & Ranges
Custom colors, tick label formatting, and highlighted ranges with a legend.
| Normal | |
| Elevated | |
| Critical |
Show Code
Gauge.razor
<DwsGauge Name='GaugeDemo_Ranges' Title='Server Load' Value='72' MinValue='0' MaxValue='100'
SweepType='DwsGaugeSweepType.ThreeQuarter'
ValueColor='var(--warning)' TrackColor='var(--adornment-background)'
ValueSuffix='%' ShowLegend='true'
Ranges='@_loadRanges' />Gauge.razor.cs
private readonly List<DwsGaugeRange> _loadRanges =
[
new DwsGaugeRange(0, 60, "var(--success)", 6, label: "Normal"),
new DwsGaugeRange(60, 85, "var(--warning)", 6, label: "Elevated"),
new DwsGaugeRange(85, 100, "var(--error)", 6, label: "Critical"),
];Pointer Value Template
PointerValueTemplate replaces how the value in the middle of the dial is shown - here a bold percentage.
Show Code
Gauge.razor
<DwsGauge Name='GaugeDemo_Template' Title='Battery' Value='54' MinValue='0' MaxValue='100'
SweepType='DwsGaugeSweepType.Half' ValueColor='var(--success)'>
<PointerValueTemplate Context='value'>
<strong>@value.ToString("0")%</strong>
</PointerValueTemplate>
</DwsGauge>Onion (Multi-Value) Gauge
Multiple concentric value rings sharing one gauge.
| CPU (68) | |
| Memory (45) | |
| Disk (82) |
Show Code
Gauge.razor
<DwsGauge Name='GaugeDemo_Onion' Title='Resource Usage' GaugeType='DwsGaugeType.Onion' SweepType='DwsGaugeSweepType.Full'
ShowLegend='true' Values='@_onionValues' />Gauge.razor.cs
private readonly List<DwsGaugeValue> _onionValues =
[
new DwsGaugeValue("CPU", 68, "var(--primary)"),
new DwsGaugeValue("Memory", 45, "var(--success)"),
new DwsGaugeValue("Disk", 82, "var(--warning)"),
];Linear Gauge & Orientation
GaugeType Linear without any axis builds one scale from the gauge's own parameters (MinValue, MaxValue, Value, ticks, Thickness, colors). Orientation puts it horizontally or vertically - the vertical form suits narrow phone screens.
Show Code
Gauge.razor
<DwsGauge Name='GaugeDemo_LinearHorizontal' Title='Download' GaugeType='DwsGaugeType.Linear' Value='64' ValueSuffix='%' />
<DwsGauge Name='GaugeDemo_LinearVertical' Title='Tank level' GaugeType='DwsGaugeType.Linear' Orientation='DwsLayoutOrientation.Vertical'
Height='240' Value='35' ValueSuffix=' l' MaxValue='80' MajorTickCount='8'
PointerType='DwsLinearGaugePointerType.Marker' MarkerShape='DwsLinearGaugeMarkerShape.Arrow' ValueColor='var(--info)' />Pointer Types & Positions
Marker pointers in every shape, a bar pointer filling a container, a text pointer, and the Near / Center / Far placement. Hover a pointer for its tooltip. The gauge is 520px wide: on a narrower screen it shrinks to fit, and its tick labels are enlarged again and thinned out so they stay readable (AdaptTickLabelsToWidth, on by default).
Show Code
Gauge.razor
<DwsGauge Name='GaugeDemo_LinearPointerTypes' Title='Pointer types' GaugeType='DwsGaugeType.Linear' Width='520' Axes='@_pointerTypeAxes' />Gauge.razor.cs
private readonly List<DwsLinearGaugeAxis> _pointerTypeAxes =
[
new DwsLinearGaugeAxis
{
Maximum = 100,
Pointers =
[
new DwsLinearGaugePointer(5) { MarkerShape = DwsLinearGaugeMarkerShape.Triangle, Label = "Triangle" },
new DwsLinearGaugePointer(18) { MarkerShape = DwsLinearGaugeMarkerShape.InvertedTriangle, Label = "InvertedTriangle", Color = "var(--secondary)" },
new DwsLinearGaugePointer(31) { MarkerShape = DwsLinearGaugeMarkerShape.Circle, Label = "Circle", Color = "var(--success)" },
new DwsLinearGaugePointer(44) { MarkerShape = DwsLinearGaugeMarkerShape.Rectangle, Label = "Rectangle", Color = "var(--info)" },
new DwsLinearGaugePointer(57) { MarkerShape = DwsLinearGaugeMarkerShape.Diamond, Label = "Diamond", Color = "var(--warning)" },
new DwsLinearGaugePointer(70) { MarkerShape = DwsLinearGaugeMarkerShape.Arrow, Label = "Arrow", Height = 18, Color = "var(--error)" },
new DwsLinearGaugePointer(83) { MarkerShape = DwsLinearGaugeMarkerShape.InvertedArrow, Label = "InvertedArrow", Height = 18 },
new DwsLinearGaugePointer(96) { MarkerShape = DwsLinearGaugeMarkerShape.Line, Label = "Line", Height = 20, Color = "var(--text)" },
],
},
new DwsLinearGaugeAxis
{
Maximum = 100,
ShowLine = false,
ContainerType = DwsLinearGaugeContainerType.Normal,
ContainerWidth = 18,
LabelSuffix = "%",
Pointers =
[
new DwsLinearGaugePointer(62, DwsLinearGaugePointerType.Bar, label: "Bar (Center)") { Placement = DwsLinearGaugePlacement.Center },
new DwsLinearGaugePointer(62, DwsLinearGaugePointerType.Text, label: "Text") { Text = "62 %", Placement = DwsLinearGaugePlacement.Near, Offset = 2 },
],
},
new DwsLinearGaugeAxis
{
Maximum = 100,
Pointers =
[
new DwsLinearGaugePointer(25, color: "var(--primary)", label: "Near") { Placement = DwsLinearGaugePlacement.Near },
new DwsLinearGaugePointer(50, color: "var(--success)", label: "Center") { Placement = DwsLinearGaugePlacement.Center, MarkerShape = DwsLinearGaugeMarkerShape.Circle },
new DwsLinearGaugePointer(75, color: "var(--error)", label: "Far") { Placement = DwsLinearGaugePlacement.Far, Offset = 18 },
],
},
];Axis Customization
Label font, size, color, prefix and suffix; major and minor tick height, width and color; offsets for the line, ticks and labels; and the axis line.
Show Code
Gauge.razor
<DwsGauge Name='GaugeDemo_LinearStyledAxis' Title='Pressure' GaugeType='DwsGaugeType.Linear' Axes='@_styledAxes' />Gauge.razor.cs
private readonly List<DwsLinearGaugeAxis> _styledAxes =
[
new DwsLinearGaugeAxis
{
Maximum = 10,
MajorTickInterval = 2,
MinorTicksPerInterval = 3,
LineWidth = 4,
LineColor = "var(--info)",
LineOffset = 4,
TickPlacement = DwsLinearGaugePlacement.Near,
TickOffset = 3,
MajorTickHeight = 14,
MajorTickWidth = 3,
MajorTickColor = "var(--info)",
MinorTickHeight = 7,
MinorTickColor = "var(--text)",
LabelOffset = 2,
LabelFontSize = 14,
LabelFontStyle = "italic",
LabelFontWeight = "600",
LabelColor = "var(--info)",
LabelSuffix = " bar",
LabelFormat = "0.0",
Pointers = [new DwsLinearGaugePointer(6.4, label: "Pressure") { Placement = DwsLinearGaugePlacement.Far, MarkerShape = DwsLinearGaugeMarkerShape.Arrow, Height = 18 }],
},
];Inversed axis
IsInversed runs the scale backwards - right to left, or top to bottom - here a countdown from 60 seconds.
Show Code
Gauge.razor
<DwsGauge Name='GaugeDemo_LinearInversedAxis' Title='Countdown (inversed)' GaugeType='DwsGaugeType.Linear' Axes='@_inversedAxes' />Gauge.razor.cs
private readonly List<DwsLinearGaugeAxis> _inversedAxes =
[
new DwsLinearGaugeAxis
{
Maximum = 60,
IsInversed = true,
MajorTickInterval = 10,
LabelSuffix = " s",
Pointers = [new DwsLinearGaugePointer(42, DwsLinearGaugePointerType.Bar, "var(--warning)", "Remaining") { Placement = DwsLinearGaugePlacement.Near, Height = 8 }],
},
];Multiple Axes
Several axes share one gauge: a thermometer with Celsius and Fahrenheit scales (a Thermometer container filled by the bar pointer), and a ruler with inch and centimetre scales whose line marker can be dragged.
Show Code
Gauge.razor
<DwsGauge Name='GaugeDemo_LinearThermometer' Title='Temperature' GaugeType='DwsGaugeType.Linear' Orientation='DwsLayoutOrientation.Vertical'
Height='300' Axes='@_thermometerAxes' />
<DwsGauge Name='GaugeDemo_LinearRuler' Title='Ruler' GaugeType='DwsGaugeType.Linear' Width='480' Axes='@_rulerAxes' />Gauge.razor.cs
private readonly List<DwsLinearGaugeAxis> _thermometerAxes =
[
new DwsLinearGaugeAxis
{
Minimum = -20,
Maximum = 50,
Title = "Celsius",
ShowTitle = true,
MajorTickInterval = 10,
TickPlacement = DwsLinearGaugePlacement.Near,
LabelSuffix = " °C",
ContainerType = DwsLinearGaugeContainerType.Thermometer,
ContainerWidth = 16,
Pointers = [new DwsLinearGaugePointer(24, DwsLinearGaugePointerType.Bar, "var(--error)", "Celsius") { Placement = DwsLinearGaugePlacement.Center, Draggable = true, Step = 0.5 }],
},
new DwsLinearGaugeAxis
{
Minimum = -4,
Maximum = 122,
Title = "Fahrenheit",
ShowTitle = true,
MajorTickInterval = 20,
LabelSuffix = " °F",
ShowLine = false,
},
];
private readonly List<DwsLinearGaugeAxis> _rulerAxes =
[
new DwsLinearGaugeAxis
{
Maximum = 15 / 2.54,
Title = "Inch",
MajorTickInterval = 1,
MinorTicksPerInterval = 7,
TickPlacement = DwsLinearGaugePlacement.Far,
LabelSuffix = " in",
},
new DwsLinearGaugeAxis
{
Maximum = 15,
Title = "Centimetre",
MajorTickInterval = 1,
MinorTicksPerInterval = 9,
TickPlacement = DwsLinearGaugePlacement.Near,
Pointers = [new DwsLinearGaugePointer(7.3, label: "Measure") { MarkerShape = DwsLinearGaugeMarkerShape.Line, Placement = DwsLinearGaugePlacement.Center, Height = 34, Color = "var(--error)", Draggable = true, Step = 0.1 }],
},
];Ranges
Multiple ranges show color zones; each can sit Near, Center or Far of the line with an offset, and its width can grow or shrink from StartWidth to EndWidth. The legend lists them (here on the right), hover shows their span.
| Normal (0k – 5k) | |
| High (5k – 7k) | |
| Red line (7k – 8k) |
Show Code
Gauge.razor
<DwsGauge Name='GaugeDemo_LinearRangesGauge' Title='Engine speed' GaugeType='DwsGaugeType.Linear' Width='440'
ShowLegend='true' LegendPosition='DwsChartLegendPosition.Right' Axes='@_rangeAxes' />Gauge.razor.cs
private readonly List<DwsLinearGaugeAxis> _rangeAxes =
[
new DwsLinearGaugeAxis
{
Maximum = 8000,
MajorTickInterval = 1000,
LabelFormatter = value => (value / 1000).ToString("0", System.Globalization.CultureInfo.InvariantCulture),
LabelSuffix = "k",
Ranges =
[
new DwsLinearGaugeRange(0, 5000, "var(--success)", 4, 8, "Normal") { Position = DwsLinearGaugePlacement.Far, Offset = 26 },
new DwsLinearGaugeRange(5000, 6500, "var(--warning)", 8, 12, "High") { Position = DwsLinearGaugePlacement.Far, Offset = 26 },
new DwsLinearGaugeRange(6500, 8000, "var(--error)", 12, 18, "Red line") { Position = DwsLinearGaugePlacement.Far, Offset = 26 },
],
Pointers = [new DwsLinearGaugePointer(5800, color: "var(--text)", label: "Engine speed") { MarkerShape = DwsLinearGaugeMarkerShape.Triangle, ShowInLegend = false }],
},
];Legend position
LegendPosition places the legend Top, Bottom, Left, Right or Auto - for every gauge type. Left, Right and Auto put it beside the gauge only while the gauge itself is at least 576px wide (its own width, not the screen's); in a narrower gauge the legend goes below.
| Normal (0% – 60%) | |
| Elevated (60% – 85%) | |
| Critical (85% – 100%) |
| Normal | |
| Elevated | |
| Critical |
Show Code
Gauge.razor
<DwsGauge Name='GaugeDemo_LinearLegendTop' Title='Linear, legend top' GaugeType='DwsGaugeType.Linear' Width='420' Value='72'
ShowLegend='true' LegendPosition='DwsChartLegendPosition.Top' Ranges='@_loadRanges' ValueSuffix='%' />
<DwsGauge Name='GaugeDemo_CircularLegendLeft' Title='Circular, legend left' Width='380' Value='72' ValueSuffix='%'
ShowLegend='true' LegendPosition='DwsChartLegendPosition.Left' Ranges='@_loadRanges' />Gauge.razor.cs
private readonly List<DwsGaugeRange> _loadRanges =
[
new DwsGaugeRange(0, 60, "var(--success)", 6, label: "Normal"),
new DwsGaugeRange(60, 85, "var(--warning)", 6, label: "Elevated"),
new DwsGaugeRange(85, 100, "var(--error)", 6, label: "Critical"),
];A phone status screen: caption, loading and empty state
Device status as a phone shows it: two small dials side by side and a linear gauge across the screen. Every gauge measures its own width, so a 140px dial still has readable text and shows only the tick labels that fit. Caption writes a sentence under a gauge (its aria-describedby points at it), IsLoading shows the loading state while the values are fetched, and EmptyContent replaces a gauge whose Value is not a number - here a sensor that sends nothing.
About 9 hours left.
Sensor offline - no reading since 08:12.
46 of 64 GB used.
Show Code
Gauge.razor
<DwsSwitch Name="PhoneLoading" @bind-Value="_phoneLoading" Label="IsLoading" Class="mb-3" />
<div class="row g-2" style="max-width: 480px;">
<div class="col-6">
<div class="border rounded p-2 h-100">
<DwsGauge Name="BatteryGauge" Title="Battery" Value="54" SweepType="DwsGaugeSweepType.Half" ValueSuffix="%" ValueColor="var(--success)"
MajorTickCount="4" Caption="About 9 hours left." IsLoading="@_phoneLoading" />
</div>
</div>
<div class="col-6">
<div class="border rounded p-2 h-100">
@* A sensor that sends nothing: a Value that is not a number shows the EmptyContent. *@
<DwsGauge Name="TemperatureGauge" Title="Temperature" Value="double.NaN" MaxValue="80" SweepType="DwsGaugeSweepType.Half" ValueSuffix=" °C"
MajorTickCount="4" IsLoading="@_phoneLoading">
<EmptyContent>
<DwsTypography Name="TemperatureOffline" Typography="DwsTypographyType.Paragraph" Class="mb-0">Sensor offline - no reading since 08:12.</DwsTypography>
</EmptyContent>
</DwsGauge>
</div>
</div>
<div class="col-12">
<div class="border rounded p-2">
<DwsGauge Name="StorageGauge" Title="Storage" GaugeType="DwsGaugeType.Linear" Value="72" ValueSuffix="%" MajorTickCount="4"
Caption="46 of 64 GB used." IsLoading="@_phoneLoading" />
</div>
</div>
</div>Gauge.razor.cs
private bool _phoneLoading;Size
Width and Height are pixel sizes, never wider than the container: on a narrower screen the drawing shrinks to fit, while its tick labels and value keep their screen size (the labels that no longer fit are thinned out). MinWidth / MaxWidth / MinHeight / MaxHeight limit it. This linear gauge is 600 px wide.
Show Code
Gauge.razor
<DwsGauge Name='GaugeDemo_LinearSized' Title='Width 600' GaugeType='DwsGaugeType.Linear' Width='600' Value='72' ValueSuffix='%' />Linear Gauge Models
The members of DwsLinearGaugeAxis, DwsLinearGaugePointer and DwsLinearGaugeRange, which describe a linear gauge's scales.
| Class | Member | Type | Default | Description |
|---|---|---|---|---|
| Axis | Minimum / Maximum | double | 0 / 100 | The scale. |
| Axis | IsInversed | bool | false | Runs the scale backwards (right to left, top to bottom). |
| Axis | Title / ShowTitle | string? / bool | null / false | Name of the axis, used in its pointers' accessible names; ShowTitle also draws it before the start of the scale. |
| Axis | ShowLine / LineWidth / LineColor / LineOffset | bool / double / string? / double | true / 2 / null / 0 | The axis line, and how far it is moved across the axis. |
| Axis | ContainerType | DwsLinearGaugeContainerType | None | None, Normal, RoundedRectangle or Thermometer frame around the line (replaces the line). |
| Axis | ContainerWidth / ContainerColor / ContainerBorderColor / ContainerBorderWidth | double / string? / string? / double | 20 / null / null / 1 | Size and colors of the container. |
| Axis | TickPlacement | DwsLinearGaugePlacement | Far | Side of the line the ticks and labels are drawn on. |
| Axis | ShowTicks / MajorTickInterval / MinorTicksPerInterval | bool / double? / int | true / null / 4 | Ticks; a null interval picks a round one (about ten ticks). |
| Axis | MajorTickHeight / MajorTickWidth / MajorTickColor | double / double / string? | 10 / 1.5 / null | Major tick style. |
| Axis | MinorTickHeight / MinorTickWidth / MinorTickColor | double / double / string? | 5 / 1 / null | Minor tick style. |
| Axis | TickOffset / LabelOffset | double | 0 | Gap between the line and the ticks, and between the ticks and the labels. |
| Axis | ShowLabels / LabelFontSize / LabelFontFamily / LabelFontStyle / LabelFontWeight / LabelColor | bool / double / string? | true / 12 / null | Label look. |
| Axis | LabelPrefix / LabelSuffix / LabelFormat / LabelFormatter | string / string / string? / Func<double, string>? | "" / "" / null / null | Label text; the format defaults to "0.##". |
| Axis | Ranges / Pointers | List<DwsLinearGaugeRange> / List<DwsLinearGaugePointer> | [] | Bands and values on this axis. |
| Pointer | Value | double | 0 | The value; a dragged pointer writes the new value back here. |
| Pointer | Type | DwsLinearGaugePointerType | Marker | Marker, Bar or Text. |
| Pointer | MarkerShape | DwsLinearGaugeMarkerShape | Triangle | Triangle, InvertedTriangle, Circle, Rectangle, Diamond, Arrow, InvertedArrow or Line. |
| Pointer | Placement / Offset | DwsLinearGaugePlacement / double | Near / 0 | Side of the line, and the extra distance from it. |
| Pointer | Color / Width / Height | string? / double / double? | null / 14 / null | Color; marker size along and across the axis (Height is a bar's thickness). |
| Pointer | Text / FontSize | string? / double | null / 13 | A text pointer's text (null shows the value) and size. |
| Pointer | Draggable / Step | bool / double? | false / null | Lets the user drag the pointer or move it with the keyboard; Step snaps it. |
| Pointer | Label / ShowInLegend | string? / bool | null / true | Name in the tooltip, legend and accessible name. |
| Range | Start / End | double | 0 / 0 | The span, in axis units. |
| Range | StartWidth / EndWidth | double | 10 / 10 | Thickness at each end; different values draw a growing band. |
| Range | Position / Offset | DwsLinearGaugePlacement / double | Center / 0 | Side of the line, and the extra distance from it. |
| Range | Color / Label | string? / string? | null / null | Color, and the name in the tooltip and legend. |
Show Code
Gauge.razor.cs
// One scale with a range and a draggable marker; pass a list of these to Axes.
new DwsLinearGaugeAxis
{
Minimum = 0,
Maximum = 200,
Ranges = [new DwsLinearGaugeRange(150, 200, "var(--error)", startWidth: 4, endWidth: 12, label: "Too fast")],
Pointers = [new DwsLinearGaugePointer(120, label: "Speed") { Draggable = true, Step = 1 }],
};Interface-Description
| Name | Typ | Default | Description |
|---|---|---|---|
| Value | double | 0 | Current value of the gauge (ignored for Onion; use Values instead). |
| MinValue | double | 0 | Minimum value of the gauge's scale. |
| MaxValue | double | 100 | Maximum value of the gauge's scale. |
| GaugeType | DwsGaugeType | DwsGaugeType.Circular | Circular (single value), Onion (multiple concentric rings) or Linear (straight horizontal or vertical scale). |
| SweepType | DwsGaugeSweepType | DwsGaugeSweepType.Half | Full, ThreeQuarter, Half, Quarter, or Custom. |
| StartAngle | double? | null | Custom start angle in degrees. Used only when SweepType is Custom. |
| EndAngle | double? | null | Custom end angle in degrees. Used only when SweepType is Custom. |
| Title | string? | null | Optional title rendered above the gauge. |
| TitleTemplate | RenderFragment? | null | Overrides the default title rendering. |
| ShowPointerValue | bool | true | Shows the current value at the center of the gauge (below a Linear gauge built without Axes). |
| PointerValueTemplate | RenderFragment<double>? | null | Overrides how the current value is displayed. |
| ValuePrefix | string | "" | Text prepended to the formatted value. |
| ValueSuffix | string | "" | Text appended to the formatted value. |
| ValueFormatter | Func<double, string>? | null | Custom formatter for displayed values. |
| TickPosition | DwsGaugeTickPosition | DwsGaugeTickPosition.Outside | Outside, Inside, or None. |
| MajorTickCount | int | 10 | Number of major tick intervals across the sweep. |
| MinorTicksPerMajor | int | 5 | Number of minor ticks drawn between major ticks. |
| ShowTickLabels | bool | true | Renders numeric labels next to major ticks. |
| Ranges | List<DwsGaugeRange>? | null | Colored bands highlighting regions of the value axis. |
| Values | List<DwsGaugeValue>? | null | Value rings rendered when GaugeType is Onion. |
| Thickness | double | 14 | Stroke width of the main track/progress arc, in SVG units; the track thickness of the default Linear axis, in pixels. |
| ValueColor | string | "var(--primary)" | CSS color of the progress arc/needle. |
| TrackColor | string | "var(--adornment-background)" | CSS color of the unfilled track. |
| EnableAnimation | bool | true | Animates the progress arc/needle between value changes. |
| AnimationDurationMs | int | 700 | Duration, in milliseconds, of the value transition animation. |
| ShowTooltip | bool | true | Shows a hover tooltip for Onion gauge rings and for linear pointers and ranges (pointers also show it while focused). |
| ShowLegend | bool | false | Shows a legend listing ranges (Circular), value rings (Onion), or ranges and labelled pointers (Linear). |
| Interactive | bool | false | Allows the user to drag the pointer to change Value (Circular, and the default Linear axis). Linear axes use DwsLinearGaugePointer.Draggable instead. |
| ValueChangedDelay | int | 0 | While the pointer is dragged, OnValueChanged (and OnPointerValueChanged) is raised only once the value has rested for this many ms, and in any case on release; the gauge itself follows at once. 0 raises it for every change. Keyboard steps are always reported at once. |
| ValueRangeFormatter | Func<double, DwsGaugeRange?, string>? | null | Formats the value readout (the number in the dial, its tooltip and accessible text) with the range the value lies in, null outside every range. Wins over DwsGaugeRange.ValueFormat (a .NET number format per range) and ValueFormatter; tick labels keep ValueFormatter. ValuePrefix and ValueSuffix are still added. |
| AdaptLabelsToSize | bool | true | Dials (Circular): keeps the tick labels and the value readable at any size. The text is drawn in the dial's own units; with this set the script measures the dial and holds the tick labels between LabelMinSize and LabelMaxSize pixels (the value at about 1.3 to 2.2 times that), and on a small dial shows only every second, fourth or eighth tick label where they would collide. Needs interactivity. Custom CSS on .dws-gauge-tick-label / .dws-gauge-value-text still wins. |
| LabelMinSize | double | 11 | Smallest size of a dial's tick labels on screen, in px (with AdaptLabelsToSize). |
| LabelMaxSize | double | 14 | Largest size of a dial's tick labels on screen, in px (with AdaptLabelsToSize). |
| Orientation | DwsLayoutOrientation | DwsLayoutOrientation.Horizontal | Linear only: Horizontal or Vertical. |
| Axes | List<DwsLinearGaugeAxis>? | null | Linear only: the scales, drawn side by side. When empty, one axis is built from MinValue, MaxValue, Value, Ranges, the tick parameters, Thickness, TrackColor, ValueColor and Interactive. |
| PointerType | DwsLinearGaugePointerType | DwsLinearGaugePointerType.Bar | Linear only: Marker, Bar or Text pointer of the default axis. |
| MarkerShape | DwsLinearGaugeMarkerShape | DwsLinearGaugeMarkerShape.Triangle | Linear only: marker shape of the default axis' pointer. |
| AdaptTickLabelsToWidth | bool | true | Linear only: a gauge wider than the screen shrinks to fit, and its tick labels with it. With this set the labels are enlarged again there (1.5, 2 or 3 times, by how much wider the gauge is than the screen) and only every second, fourth ... label is shown where they would collide. Goes by the screen width, not by the container's. |
| LegendPosition | DwsChartLegendPosition | DwsChartLegendPosition.Bottom | Top, Bottom, Left or Right of the gauge (Left and Right move below it on phones). |
| EmptyContent | RenderFragment? | null | Shown instead of the gauge when there is nothing to show: a non-finite Value (an onion gauge: no Values). Not while loading. Null draws the empty dial. |
| IsLoading | bool | false | Shows the loading state instead of the gauge, e.g. while the page fetches the value. |
| Caption | string? | null | A sentence under the gauge (<p class="dws-chart-caption">) - the takeaway or the source; the drawing's aria-describedby points at it. |
| Width | int? | null | Width in pixels; still shrinks to a narrower container unless MaxWidth is set. A horizontal Linear gauge draws its scale to this width instead (a side legend comes on top). |
| Height | int? | null | Height in pixels. A vertical Linear gauge draws its scale to this height instead (title and value text come on top). |
| MinWidth | int? | null | Minimum width in pixels. |
| MaxWidth | int? | null | Maximum width in pixels. |
| MinHeight | int? | null | Minimum height in pixels. |
| MaxHeight | int? | null | Maximum height in pixels. |
| Name | Typ | Description |
|---|---|---|
| OnValueChanged | EventCallback<double> | Raised while the user drags the pointer or moves it with the keyboard (Interactive gauges only). |
| OnPointerValueChanged | EventCallback<DwsLinearGaugePointerValueChangedEventArgs> | Linear only: raised while the user drags any pointer or moves it with the keyboard; carries the axis, the pointer, their indexes, the new and the previous value. |
| Name | Typ | Default | Description |
|---|---|---|---|
| Element | ElementReference | The associated web component. May be null if accessed before the component is rendered. | |
| ComponentGuid | Guid | Unique identifier for the component. | |
| TypeString | string | The name of the component type, obtained from reflection. | |
| Authorized_RegisterEnabled | bool | false | Indicates whether this component is enabled through a permission registry. |
| Authorized_RegisterSelected | bool | false | Indicates whether this component is selected in permission selection mode. |
| GetInitializedState | bool | false | Returns whether the component is initialized. |
| GetRenderModeState | DwsRenderMode | Returns the current render mode. | |
| GetComponentState | DwsComponentStateType | Returns the current component state. | |
| GetIsInteractiveState | bool | false | Returns whether the component is interactive. |
| GetIsPrerenderingState | bool | false | Returns whether the component is prerendering. |
| GetComponentLoadingState | bool | false | Returns whether the component is loading. |
| IsFormBusy | bool | false | Whether the DwsForm (or DwsFormBusyRegion) around the component is locked because its submit handler is running. The state itself is the cascaded FormBusyState (IDwsFormBusyState). |
| Name | Typ | Parameters | Description |
|---|---|---|---|
| DebugInfo | void | Logs debug information about the component. | |
| UpdateState | void | Updates the component's state and triggers StateHasChanged. | |
| UpdateStateAsync | Task | Asynchronously updates the component's state and triggers StateHasChanged. | |
| Dispose | void | Disposes the component and releases resources. | |
| FocusAsync | ValueTask | bool containedInScrollableList | Sets focus to the component's element. |
| Name | Typ | Default | Description |
|---|---|---|---|
| Name | string | Required unique identifier for the component within its container. | |
| Visible | bool | true | Determines if the component is visible in the UI. |
| Disabled | bool | false | Disables the form control, ensuring it doesn't participate in form submission. |
| ComponentNameSpace | string | The namespace for permission-based access control. | |
| PermissionKey | string? | null | A stable key that takes the place of Name in the generated permission namespace (Page.PermissionKey): the stored permission survives a rename, and components that share a key share one permission entry. Null: keyed by Name. Read once, when the component registers; an explicit ComponentNameSpace wins. |
| Class | string | Optional CSS class names. | |
| Style | string | Optional in-line styles. | |
| Tag | object | An optional user-defined object to store any additional data with the component. | |
| BackReference | DwsReference | A reference to the enclosing component. | |
| ID | string | The HTML ID attribute for the component. | |
| AdditionalAttributes | Dictionary<string, object> | Additional HTML attributes for the component's root element. | |
| IgnorePermissionChecks | bool | false | Bypasses all permission checks for this component. |
| IgnorePermissionSelection | bool | false | Ignore permission selection mode for this component. |
| IgnoreFormBusy | bool | false | Takes the component out of the submit lock of the DwsForm (or DwsFormBusyRegion) around it: IsFormBusy stays false for it. |
| Name | Typ | Description |
|---|---|---|
| OnInitializedCallbackStarted | EventCallback | Callback when OnInitialized starts. |
| OnInitializedCallback | EventCallback | Callback during OnInitialized. |
| OnInitializedCallbackCompleted | EventCallback | Callback when OnInitialized completes. |
| OnInitializedAsyncCallbackStarted | EventCallback | Callback when OnInitializedAsync starts. |
| OnInitializedAsyncCallback | EventCallback | Callback during OnInitializedAsync. |
| OnInitializedAsyncCallbackCompleted | EventCallback | Callback when OnInitializedAsync completes. |
| OnIsComponentLoadingChanged | EventCallback<bool> | Callback when IsComponentLoading changes. |
| OnCurrentRenderModeChanged | EventCallback<DwsRenderMode> | Callback when CurrentRenderMode changes. |
| OnComponentStateChanged | EventCallback<DwsComponentStateType> | Callback when ComponentState changes. |
