you need more than you'd expect, as by default a radial gauge has 0 scales in it, and nothing has a brush set. there's a fair amount of complexity we settled on in order to provide the most flexible object model possible. i suggest either loading an xml preset, or using a wrapper class like "MiniGauge" here.
(this class also contains the minimum amount of code needed to generate the gauge.)
internal class MiniGauge : UltraGauge
{
public MiniGauge(): base()
{
LinearGauge lin = new LinearGauge();
lin.Margin = new Margin(0.0);
this.Gauges.Add(lin);
lin.Scales.Add(new LinearGaugeScale());lin.Scales[0].Axis = new NumericAxis();
lin.Scales[0].StartExtent = 0.0;
lin.Scales[0].EndExtent = 100.0;
lin.Scales[0].InnerExtent = 0.0;
lin.Scales[0].OuterExtent = 100.0;
LinearGaugeBarMarker marker = new LinearGaugeBarMarker();
lin.Scales[0].Markers.Add(marker);
marker.StartExtent = 0.0;
marker.InnerExtent = 0.0;
marker.OuterExtent = 100.0;
SimpleGradientBrushElement markerBrush = new SimpleGradientBrushElement();
marker.BrushElement = markerBrush;
markerBrush.StartColor = Color.Yellow;
markerBrush.EndColor = Color.Orange;
markerBrush.GradientStyle = Gradient.Horizontal;
SolidFillBrushElement backBrush = new SolidFillBrushElement(Color.Black);
this.BackColor = Color.Blue;
}
public virtual double Value
{
get
{
return (double)((LinearGauge)this.Gauges[0]).Scales[0].Markers[0].Value;
}
set
{
((LinearGauge)this.Gauges[0]).Scales[0].Markers[0].Value = value;
}
}
}