| Parameter | Type | Default | Description |
Value | double | 0 | The reading. Drawn and announced clamped into Min to Max. |
Min | double | 0 | Start of the scale. |
Max | double | 100 | End of the scale; must be above Min. |
Ranges | IReadOnlyList<GaugeRange> | Array.Empty<GaugeRange>() | Colored bands along the scale, each with a label for its tooltip. |
Pointers | IReadOnlyList<GaugePointer> | Array.Empty<GaugePointer>() | Extra markers: needles on the round gauges, vertical marks on the linear one, each with a color and a label. |
Color | string | "#2563eb" | Color of the value arc or bar and of the radial gauge's needle. |
TickCount | int | 5 | Number of intervals on the scale, 1 to 100; one label per interval boundary. |
LabelFormat | string | "0" | Numeric format of the tick labels. |
ValueFormat | string | "0.##" | Numeric format of the printed value. |
Height | string | "260px" | Height of the drawing; the width follows the container. |
AriaLabel | string | "Gauge" | Accessible name of the meter. |
ValueTemplate | RenderFragment<GaugeValueContext>? | null | Replaces the printed value with your own content, centered over the gauge; receives value, min and max. |
GaugeRange(double From, double To, string Color, string? Label = null) and
GaugePointer(double Value, string Color = "#dc2626", string? Label = null) are records;
GaugeValueContext(double Value, double Min, double Max) is what a ValueTemplate receives.
CssClass, Style, Id, Visible and AdditionalAttributes come from
FlexControlBase and apply to the root div.
How the gauges draw, from the shared SVG:
- The arc, radial and circular gauges use a 300 by 300 view box. The track and the ranges are 16 px arcs; the value arc is 16 px on its own and 7 px over ranges. The arc and radial gauges sweep 270 degrees from the lower left; the circular gauge sweeps the full 360.
- The radial gauge draws a needle for the value; every gauge draws a needle, or a vertical mark on the linear gauge, for each pointer. Ranges and pointers carry a
title with their label, so hovering shows it.
TickCount intervals give TickCount + 1 labels formatted with LabelFormat; the circular gauge drops the last one, which would overlap the first.
- The value is printed in the middle with
ValueFormat unless a ValueTemplate is set, in which case the template is centered over the drawing.
- For drawing and for
aria-valuenow the value is clamped into Min to Max; a range or pointer outside that span is clamped the same way.
- The gauge throws when a value is not finite, when
Max is not above Min, when TickCount is outside 1 to 100, or when a range ends before it starts.