Gauges & stock chart

ArcGaugeControl · CircularGaugeControl · RadialGaugeControl · LinearGaugeControl · StockChartControl

Read a value against its target at a glance, and browse prices by date.

Overview

Four Blazor gauges show a single value against its limits at a glance: ArcGaugeControl, CircularGaugeControl, RadialGaugeControl and LinearGaugeControl, which share one set of parameters. Use them for utilization, progress or throughput on a dashboard: colored Ranges mark the zones and extra Pointers show a target beside the reading. StockChartControl adds date pickers, zoom and pan to a candlestick, OHLC or high-low chart.

Examples

#Four gauges, one value

Move one value through all four gauges and hover a range or pointer for its label; the radial gauge carries a second needle for the target.

Arc

Circular

65 of 100

Radial

Linear

#Stock chart

Use the pickers, Zoom in, Zoom out, Earlier and Later on ninety days of generated prices, or set the range from the page with SetRangeAsync; the line below counts the trading days in view.

97.8101.7105.6109.4113.3 Sep 15 Sep 16 Sep 17 Sep 18 Sep 21 Sep 22 Sep 23 Sep 24 Sep 25 Sep 28 Sep 29 Sep 30 Oct 1 Oct 2

Range: Sep 15 to Oct 2, 14 trading days.

Documentation

ParameterTypeDefaultDescription
Valuedouble0The reading. Drawn and announced clamped into Min to Max.
Mindouble0Start of the scale.
Maxdouble100End of the scale; must be above Min.
RangesIReadOnlyList<GaugeRange>Array.Empty<GaugeRange>()Colored bands along the scale, each with a label for its tooltip.
PointersIReadOnlyList<GaugePointer>Array.Empty<GaugePointer>()Extra markers: needles on the round gauges, vertical marks on the linear one, each with a color and a label.
Colorstring"#2563eb"Color of the value arc or bar and of the radial gauge's needle.
TickCountint5Number of intervals on the scale, 1 to 100; one label per interval boundary.
LabelFormatstring"0"Numeric format of the tick labels.
ValueFormatstring"0.##"Numeric format of the printed value.
Heightstring"260px"Height of the drawing; the width follows the container.
AriaLabelstring"Gauge"Accessible name of the meter.
ValueTemplateRenderFragment<GaugeValueContext>?nullReplaces 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.
An unhandled error has occurred. Reload 🗙

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.