Radial gauge
A radial gauge chart can be created from a few values.
ScottPlot.Plot myPlot = new();
double[] values = { 100, 80, 65, 45, 20 };
myPlot.Add.RadialGaugePlot(values);
myPlot.SavePng("demo.png", 400, 300);
Gauge colors can be customized by changing the default palette.
ScottPlot.Plot myPlot = new();
myPlot.Add.Palette = new ScottPlot.Palettes.Nord();
double[] values = { 100, 80, 65, 45, 20 };
myPlot.Add.RadialGaugePlot(values);
myPlot.SavePng("demo.png", 400, 300);
Radial gauge plots support positive and negative values.
ScottPlot.Plot myPlot = new();
myPlot.Add.Palette = new ScottPlot.Palettes.Nord();
double[] values = { 100, 80, -65, 45, -20 };
myPlot.Add.RadialGaugePlot(values);
myPlot.SavePng("demo.png", 400, 300);
Sequential gauge mode indicates that the base of each gauge starts at the tip of the previous gauge.
ScottPlot.Plot myPlot = new();
myPlot.Add.Palette = new ScottPlot.Palettes.Nord();
double[] values = { 100, 80, 65, 45, 50 };
var radialGaugePlot = myPlot.Add.RadialGaugePlot(values);
radialGaugePlot.GaugeMode = ScottPlot.RadialGaugeMode.Sequential;
myPlot.SavePng("demo.png", 400, 300);
Gauges are displayed from the center outward by default but the order can be customized.
ScottPlot.Plot myPlot = new();
myPlot.Add.Palette = new ScottPlot.Palettes.Nord();
double[] values = { 100, 80, 65, 45, 50 };
var radialGaugePlot = myPlot.Add.RadialGaugePlot(values);
radialGaugePlot.GaugeMode = ScottPlot.RadialGaugeMode.Sequential;
radialGaugePlot.OrderInsideOut = false;
myPlot.SavePng("demo.png", 400, 300);
The SingleGauge mode draws all gauges stacked together as a single gauge. This is useful for showing a progress gauges composed of many individual smaller gauges.
ScottPlot.Plot myPlot = new();
myPlot.Add.Palette = new ScottPlot.Palettes.Nord();
double[] values = { 100, 80, 65, 45 };
var radialGaugePlot = myPlot.Add.RadialGaugePlot(values);
radialGaugePlot.GaugeMode = ScottPlot.RadialGaugeMode.SingleGauge;
radialGaugePlot.MaximumAngle = 180;
radialGaugePlot.StartingAngle = 180;
myPlot.SavePng("demo.png", 400, 300);
The direction of gauges can be customized. Clockwise is used by default.
ScottPlot.Plot myPlot = new();
myPlot.Add.Palette = new ScottPlot.Palettes.Nord();
double[] values = { 100, 80, 65, 45, 20 };
var radialGaugePlot = myPlot.Add.RadialGaugePlot(values);
radialGaugePlot.Clockwise = false;
myPlot.SavePng("demo.png", 400, 300);
The empty space between gauges can be adjusted as a fraction of their width.
ScottPlot.Plot myPlot = new();
myPlot.Add.Palette = new ScottPlot.Palettes.Nord();
double[] values = { 100, 80, 65, 45, 20 };
var radialGaugePlot = myPlot.Add.RadialGaugePlot(values);
radialGaugePlot.SpaceFraction = .05;
myPlot.SavePng("demo.png", 400, 300);
The starting angle for gauges can be customized. 270 for North (default value), 0 for East, 90 for South, 180 for West, etc.
ScottPlot.Plot myPlot = new();
myPlot.Add.Palette = new ScottPlot.Palettes.Nord();
double[] values = { 100, 80, 65, 45, 20 };
var radialGaugePlot = myPlot.Add.RadialGaugePlot(values);
radialGaugePlot.StartingAngle = 180;
myPlot.SavePng("demo.png", 400, 300);
By default gauges are full circles (360 degrees) but smaller gauges can be created by customizing the gauge size.
ScottPlot.Plot myPlot = new();
myPlot.Add.Palette = new ScottPlot.Palettes.Nord();
double[] values = { 100, 80, 65, 45, 20 };
var radialGaugePlot = myPlot.Add.RadialGaugePlot(values);
radialGaugePlot.MaximumAngle = 180;
myPlot.SavePng("demo.png", 400, 300);
The value of each gauge is displayed as text by default but this behavior can be overridden. Note that this is different than the labels fiels which is what appears in the legened.
ScottPlot.Plot myPlot = new();
myPlot.Add.Palette = new ScottPlot.Palettes.Nord();
double[] values = { 100, 80, 65, 45, 20 };
var radialGaugePlot = myPlot.Add.RadialGaugePlot(values);
radialGaugePlot.ShowLevels = false;
myPlot.SavePng("demo.png", 400, 300);
Gauge level text is positioned at the tip of each gauge by default, but this position can be adjusted by the user.
ScottPlot.Plot myPlot = new();
myPlot.Add.Palette = new ScottPlot.Palettes.Nord();
double[] values = { 100, 80, 65, 45, 20 };
var radialGaugePlot = myPlot.Add.RadialGaugePlot(values);
radialGaugePlot.LabelPositionFraction = 0.5;
myPlot.SavePng("demo.png", 400, 300);
Size of the gauge level text as a fraction of the gauge width.
ScottPlot.Plot myPlot = new();
myPlot.Add.Palette = new ScottPlot.Palettes.Nord();
double[] values = { 100, 80, 65, 45, 20 };
var radialGaugePlot = myPlot.Add.RadialGaugePlot(values);
radialGaugePlot.FontSizeFraction = .4;
myPlot.SavePng("demo.png", 400, 300);
Level text fonts may be customized.
ScottPlot.Plot myPlot = new();
myPlot.Add.Palette = new ScottPlot.Palettes.Nord();
double[] values = { 100, 80, 65, 45, 20 };
var radialGaugePlot = myPlot.Add.RadialGaugePlot(values);
radialGaugePlot.Font.Color = Colors.Black;
myPlot.SavePng("demo.png", 400, 300);
Radial gauge labels will appear in the legend if they are assigned.
ScottPlot.Plot myPlot = new();
myPlot.Add.Palette = new ScottPlot.Palettes.Nord();
double[] values = { 100, 80, 65, 45, 20 };
var radialGaugePlot = myPlot.Add.RadialGaugePlot(values);
radialGaugePlot.Labels = new string[] { "alpha", "beta", "gamma", "delta", "epsilon" };
myPlot.ShowLegend();
myPlot.SavePng("demo.png", 400, 300);
By default the full range of each gauge is drawn as a semitransparent ring. The amount of transparency can be adjusted as desired.
ScottPlot.Plot myPlot = new();
myPlot.Add.Palette = new ScottPlot.Palettes.Nord();
double[] values = { 100, 80, 65, 45, 20 };
var radialGaugePlot = myPlot.Add.RadialGaugePlot(values);
radialGaugePlot.BackgroundTransparencyFraction = .5;
myPlot.SavePng("demo.png", 400, 300);
Gauge backgrounds are drawn as full circles by default. This behavior can be disabled to draw partial backgrounds for non-circular gauges.
ScottPlot.Plot myPlot = new();
myPlot.Add.Palette = new ScottPlot.Palettes.Nord();
double[] values = { 100, 80, 65, 45, 20 };
var radialGaugePlot = myPlot.Add.RadialGaugePlot(values);
radialGaugePlot.CircularBackground = false;
radialGaugePlot.MaximumAngle = 180;
radialGaugePlot.StartingAngle = 180;
myPlot.SavePng("demo.png", 400, 300);
















