I have a range of 3 to 5, and want it to not round everything to 3,4,5 since that is useless. What am I doing wrong? Marker's always of type int. I also tried precision = null on marker and same effect.
private
UltraGauge ultraGauge;
private void InitializeComponent() {Infragistics.UltraGauge.Resources.ColorStop colorStop1 = new Infragistics.UltraGauge.Resources.ColorStop(); Infragistics.UltraGauge.Resources.ColorStop colorStop2 = new Infragistics.UltraGauge.Resources.ColorStop(); Infragistics.UltraGauge.Resources.ColorStop colorStop3 = new Infragistics.UltraGauge.Resources.ColorStop(); Infragistics.UltraGauge.Resources.ColorStop colorStop4 = new Infragistics.UltraGauge.Resources.ColorStop(); Infragistics.UltraGauge.Resources.LinearGauge linearGauge1 = new Infragistics.UltraGauge.Resources.LinearGauge(); Infragistics.UltraGauge.Resources.SimpleGradientBrushElement simpleGradientBrushElement1 = new Infragistics.UltraGauge.Resources.SimpleGradientBrushElement(); Infragistics.UltraGauge.Resources.LinearGaugeScale linearGaugeScale1 = new Infragistics.UltraGauge.Resources.LinearGaugeScale(); Infragistics.UltraGauge.Resources.SimpleGradientBrushElement simpleGradientBrushElement2 = new Infragistics.UltraGauge.Resources.SimpleGradientBrushElement(); Infragistics.UltraGauge.Resources.LinearGaugeScale linearGaugeScale2 = new Infragistics.UltraGauge.Resources.LinearGaugeScale(); Infragistics.UltraGauge.Resources.NumericAxis numericAxis1 = new Infragistics.UltraGauge.Resources.NumericAxis(3.0, 5.0, .25); Infragistics.UltraGauge.Resources.LinearGaugeBarMarker linearGaugeBarMarker1 = new Infragistics.UltraGauge.Resources.LinearGaugeBarMarker(); Infragistics.UltraGauge.Resources.SimpleGradientBrushElement simpleGradientBrushElement3 = new Infragistics.UltraGauge.Resources.SimpleGradientBrushElement(); Infragistics.UltraGauge.Resources.MultiStopLinearGradientBrushElement multiStopLinearGradientBrushElement1 = new Infragistics.UltraGauge.Resources.MultiStopLinearGradientBrushElement(); Infragistics.UltraGauge.Resources.LinearGaugeRange linearGaugeRange1 = new Infragistics.UltraGauge.Resources.LinearGaugeRange(); Infragistics.UltraGauge.Resources.SolidFillBrushElement solidFillBrushElement1 = new Infragistics.UltraGauge.Resources.SolidFillBrushElement(); Infragistics.UltraGauge.Resources.StrokeElement strokeElement1 = new Infragistics.UltraGauge.Resources.StrokeElement(); Infragistics.UltraGauge.Resources.StrokeElement strokeElement2 = new Infragistics.UltraGauge.Resources.StrokeElement(); Infragistics.UltraGauge.Resources.LinearGaugeScale linearGaugeScale3 = new Infragistics.UltraGauge.Resources.LinearGaugeScale(); Infragistics.UltraGauge.Resources.NumericAxis numericAxis2 = new Infragistics.UltraGauge.Resources.NumericAxis(3.0, 5.0, .25); Infragistics.UltraGauge.Resources.LinearGaugeScale linearGaugeScale4 = new Infragistics.UltraGauge.Resources.LinearGaugeScale(); Infragistics.UltraGauge.Resources.NumericAxis numericAxis3 = new Infragistics.UltraGauge.Resources.NumericAxis(3.0, 5.0, .25); Infragistics.UltraGauge.Resources.SolidFillBrushElement solidFillBrushElement2 = new Infragistics.UltraGauge.Resources.SolidFillBrushElement(); Infragistics.UltraGauge.Resources.LinearGaugeScale linearGaugeScale5 = new Infragistics.UltraGauge.Resources.LinearGaugeScale(); Infragistics.UltraGauge.Resources.NumericAxis numericAxis4 = new Infragistics.UltraGauge.Resources.NumericAxis(3.0, 5.0, .25); Infragistics.UltraGauge.Resources.SolidFillBrushElement solidFillBrushElement3 = new Infragistics.UltraGauge.Resources.SolidFillBrushElement(); Infragistics.UltraGauge.Resources.SolidFillBrushElement solidFillBrushElement4 = new Infragistics.UltraGauge.Resources.SolidFillBrushElement(); this.ultraGauge = new Infragistics.Win.UltraWinGauge.UltraGauge(); this.SuspendLayout(); // // ultraGauge // this.ultraGauge.BackColor = System.Drawing.Color.Transparent; this.ultraGauge.Dock = System.Windows.Forms.DockStyle.Fill; simpleGradientBrushElement1.EndColor = System.Drawing.Color.FromArgb(((int)(((byte)(150)))), ((int)(((byte)(150)))), ((int)(((byte)(150))))); simpleGradientBrushElement1.GradientStyle = Infragistics.UltraGauge.Resources.Gradient.BackwardDiagonal; simpleGradientBrushElement1.StartColor = System.Drawing.Color.Black; linearGauge1.BrushElements.Add(simpleGradientBrushElement1); linearGauge1.CornerExtent = 10; linearGauge1.Margin = new Infragistics.UltraGauge.Resources.Margin(2, 10, 2, 10, Infragistics.UltraGauge.Resources.Measure.Pixels); simpleGradientBrushElement2.EndColor = System.Drawing.Color.FromArgb(((int)(((byte)(10)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); simpleGradientBrushElement2.StartColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); linearGaugeScale1.BrushElements.Add(simpleGradientBrushElement2); linearGaugeScale1.EndExtent = 98; linearGaugeScale1.InnerExtent = 60; linearGaugeScale1.OuterExtent = 95; linearGaugeScale1.StartExtent = 2; numericAxis1.EndValue = 5.0; numericAxis1.StartValue = 3.0; numericAxis1.TickmarkInterval = 0.25; linearGaugeScale2.Axes.Add(numericAxis1); linearGaugeScale2.EndExtent = 90; linearGaugeScale2.MajorTickmarks.EndExtent = 63; linearGaugeScale2.MajorTickmarks.StartExtent = 54; linearGaugeScale2.MajorTickmarks.StrokeElement.Color = System.Drawing.Color.LightGray; simpleGradientBrushElement3.EndColor = System.Drawing.Color.DimGray; simpleGradientBrushElement3.StartColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); linearGaugeBarMarker1.Background.BrushElements.Add(simpleGradientBrushElement3); multiStopLinearGradientBrushElement1.Angle = 90F; colorStop1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(119)))), ((int)(((byte)(119))))); colorStop2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(239)))), ((int)(((byte)(87)))), ((int)(((byte)(87))))); colorStop2.Stop = 0.4172414F; colorStop3.Color = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); colorStop3.Stop = 0.4288991F; colorStop4.Color = System.Drawing.Color.FromArgb(((int)(((byte)(199)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); colorStop4.Stop = 1F; multiStopLinearGradientBrushElement1.ColorStops.Add(colorStop1); multiStopLinearGradientBrushElement1.ColorStops.Add(colorStop2); multiStopLinearGradientBrushElement1.ColorStops.Add(colorStop3); multiStopLinearGradientBrushElement1.ColorStops.Add(colorStop4); linearGaugeBarMarker1.BrushElements.Add(multiStopLinearGradientBrushElement1); linearGaugeBarMarker1.InnerExtent = 50; linearGaugeBarMarker1.OuterExtent = 70; linearGaugeBarMarker1.Precision = 0.05; linearGaugeBarMarker1.SegmentSpan = 99; linearGaugeBarMarker1.Value = 4.1; linearGaugeScale2.Markers.Add(linearGaugeBarMarker1); solidFillBrushElement1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); linearGaugeRange1.BrushElements.Add(solidFillBrushElement1); linearGaugeRange1.EndValue = 5.0; linearGaugeRange1.InnerExtent = 50; linearGaugeRange1.OuterExtent = 70; linearGaugeRange1.StartValue = 3.0; strokeElement1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(150)))), ((int)(((byte)(150)))), ((int)(((byte)(150))))); linearGaugeRange1.StrokeElement = strokeElement1; linearGaugeScale2.Ranges.Add(linearGaugeRange1); linearGaugeScale2.StartExtent = 10; strokeElement2.Color = System.Drawing.Color.Transparent; linearGaugeScale2.StrokeElement = strokeElement2; numericAxis2.EndValue = 5.0; numericAxis2.StartValue = 3.0; numericAxis2.TickmarkInterval = 0.25; linearGaugeScale3.Axes.Add(numericAxis2); linearGaugeScale3.EndExtent = 90; linearGaugeScale3.MajorTickmarks.EndExtent = 68; linearGaugeScale3.MajorTickmarks.StartExtent = 52; linearGaugeScale3.MajorTickmarks.StrokeElement.Color = System.Drawing.Color.LightGray; linearGaugeScale3.MajorTickmarks.StrokeElement.Thickness = 2; linearGaugeScale3.StartExtent = 10; numericAxis3.EndValue = 5.0; numericAxis3.StartValue = 3.0; numericAxis3.TickmarkInterval = 0.25; linearGaugeScale4.Axes.Add(numericAxis3); linearGaugeScale4.EndExtent = 90; solidFillBrushElement2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(61)))), ((int)(((byte)(22))))); linearGaugeScale4.MajorTickmarks.BrushElements.Add(solidFillBrushElement2); linearGaugeScale4.MajorTickmarks.EndExtent = 76; linearGaugeScale4.MajorTickmarks.StartExtent = 45; linearGaugeScale4.MajorTickmarks.StrokeElement.Color = System.Drawing.Color.FromArgb(((int)(((byte)(225)))), ((int)(((byte)(225)))), ((int)(((byte)(225))))); linearGaugeScale4.MajorTickmarks.StrokeElement.Thickness = 2; linearGaugeScale4.StartExtent = 10; numericAxis4.EndValue = 5.0; numericAxis4.StartValue = 3.0; numericAxis4.TickmarkInterval = 0.25; linearGaugeScale5.Axes.Add(numericAxis4); linearGaugeScale5.EndExtent = 90; solidFillBrushElement3.Color = System.Drawing.Color.White; solidFillBrushElement3.RelativeBounds = new System.Drawing.Rectangle(0, 0, 80, 0); solidFillBrushElement3.RelativeBoundsMeasure = Infragistics.UltraGauge.Resources.Measure.Percent; linearGaugeScale5.Labels.BrushElements.Add(solidFillBrushElement3); linearGaugeScale5.Labels.Extent = 24; linearGaugeScale5.Labels.Font = new System.Drawing.Font("Franklin Gothic Medium", 13F); linearGaugeScale5.Labels.FormatString = "<DATA_VALUE:0.0>"; linearGaugeScale5.Labels.Shadow.BrushElements.Add(solidFillBrushElement4); linearGaugeScale5.Labels.Shadow.Depth = 2; linearGaugeScale5.Labels.ZPosition = Infragistics.UltraGauge.Resources.LinearTickmarkZPosition.AboveMarkers; linearGaugeScale5.MajorTickmarks.EndExtent = 50; linearGaugeScale5.MajorTickmarks.EndWidth = 2; linearGaugeScale5.MajorTickmarks.StartExtent = 59; linearGaugeScale5.MajorTickmarks.StartWidth = 2; linearGaugeScale5.MajorTickmarks.StrokeElement.Color = System.Drawing.Color.Transparent; linearGaugeScale5.MajorTickmarks.StrokeElement.Thickness = 3; linearGaugeScale5.MinorTickmarks.EndExtent = 75; linearGaugeScale5.MinorTickmarks.Frequency = 0.2; linearGaugeScale5.MinorTickmarks.StartExtent = 65; linearGaugeScale5.MinorTickmarks.StrokeElement.Color = System.Drawing.Color.Transparent; linearGaugeScale5.StartExtent = 9; linearGauge1.Scales.Add(linearGaugeScale1); linearGauge1.Scales.Add(linearGaugeScale2); linearGauge1.Scales.Add(linearGaugeScale3); linearGauge1.Scales.Add(linearGaugeScale4); linearGauge1.Scales.Add(linearGaugeScale5); this.ultraGauge.Gauges.Add(linearGauge1); this.ultraGauge.Location = new System.Drawing.Point(0, 0); this.ultraGauge.Name = "ultraGauge"; this.ultraGauge.Size = new System.Drawing.Size(188, 57); this.ultraGauge.TabIndex = 0; // // TestRedHorizBarGauge // this.Controls.Add(this.ultraGauge); this.Name = "TestRedHorizBarGauge"; this.Size = new System.Drawing.Size(188, 57); this.ResumeLayout(false);
}
Never mind, the stupid hat is on, Convert.ToInt32 for your input value will do that to you...