The specific gauge I'm currently working on needs a range of -4.3 to +4.3 with zero at the center.
I can get most of this by setting the axis start value at zero and the axis end value at 8.6 and then setting the marker value to the calculated value + 4.3. What I haven't been able to figure out is how to setup the MajorTickmarks to work correctly with this.
Any suggestions?
Thanks, Dave
That might work. I forgot to mention I was working with a linear gauge but I expect that the same process would work there.
What I found that is working for me was to set the Scale.Axis.StartValue to -4.3, the Scale.Axis.EndValue to 4.3 and the Scale.MajorTickMarks.PostInitial to .3. This starts the tick marks at -4 and with the Frequency set to 1 lines the tick marks up the way I want them.
Dave
how about using 3 scales?
RadialGauge rg = new RadialGauge();rg.Scales.Add(new RadialGaugeScale());rg.Scales[0].Axis = new NumericAxis(-4.3, -4.0, 0.3);rg.Scales.Add(new RadialGaugeScale());rg.Scales[1].Axis = new NumericAxis(-4.0, 4.0, 1.0);rg.Scales.Add(new RadialGaugeScale());rg.Scales[2].Axis = new NumericAxis(4.0, 4.3, 0.3);BrushElement labelsBrushElement = new SolidFillBrushElement(Color.Black);BrushElement tickmarksBrushElement = new SolidFillBrushElement(Color.Green);rg.Scales[0].Labels.BrushElement = rg.Scales[1].Labels.BrushElement = rg.Scales[2].Labels.BrushElement = labelsBrushElement;rg.Scales[0].MajorTickmarks.BrushElement = rg.Scales[1].MajorTickmarks.BrushElement = rg.Scales[2].MajorTickmarks.BrushElement = tickmarksBrushElement;rg.Scales[0].Labels.FormatString = rg.Scales[2].Labels.FormatString = "<DATA_VALUE:0.0>";rg.Scales[0].MajorTickmarks.PreTerminal = rg.Scales[0].Labels.PreTerminal = rg.Scales[2].MajorTickmarks.PostInitial = rg.Scales[2].Labels.PostInitial = .3;rg.Scales[0].MinorTickmarks.Visible = rg.Scales[1].MinorTickmarks.Visible = rg.Scales[2].MinorTickmarks.Visible = false;double startAngle = 120.0;double endAngle = 420.0;double degreesPerUnit = (endAngle - startAngle) / 8.6;// first scale (-4.3 to -4)rg.Scales[0].StartAngle = startAngle;rg.Scales[0].EndAngle = startAngle + degreesPerUnit * .3;// middle scale (-4 to +4)rg.Scales[1].StartAngle = rg.Scales[0].EndAngle;rg.Scales[1].EndAngle = rg.Scales[1].StartAngle + degreesPerUnit * 8.0;// last scale (+4 to +4.3)rg.Scales[2].StartAngle = rg.Scales[1].EndAngle;rg.Scales[2].EndAngle = rg.Scales[2].StartAngle + degreesPerUnit * .3;ultraGauge1.Gauges.Add(rg);