Example #1
0
        private void SetCBottomMeterDesignTimeDefaults()
        {
            _GaugeControl.Frame.Style = GaugeFrameStyle.Rectangular;
            _GaugeControl.Frame.BackColor = new GradientFillColor(Color.Gainsboro, Color.DarkGray);
            _GaugeControl.Frame.FrameColor = new GradientFillColor(Color.White, Color.DimGray);
            _GaugeControl.Frame.FrameColor.BorderColor = Color.Gainsboro;
            _GaugeControl.Frame.FrameColor.BorderWidth = 1;

            _GaugeControl.Size = new Size(_GaugeControl.Size.Width, _GaugeControl.Size.Width / 3);

            GaugeCircularScale scale = new GaugeCircularScale(_GaugeControl);
            scale.Name = "Scale1";
            scale.Radius = 2.5F;

            scale.StartAngle = 240F;
            scale.SweepAngle = 60F;
            scale.Width = 0.011F;

            scale.MajorTickMarks.Interval = 50;
            scale.MajorTickMarks.Layout.Length = 0.063F;
            scale.MajorTickMarks.Layout.Width = 0.033F;

            scale.MaxPin.EndOffset = 0.01F;
            scale.MaxPin.Length = 0.026F;
            scale.MaxPin.ScaleOffset = -0.06F;
            scale.MaxPin.Width = 0.026F;

            GradientFillColor fillColor = new GradientFillColor(Color.LightYellow);
            fillColor.BorderColor = Color.DimGray;
            fillColor.BorderWidth = 1;

            scale.MinorTickMarks.Interval = 10;
            scale.MinorTickMarks.Layout.FillColor = fillColor;
            scale.MinorTickMarks.Layout.Length = 0.042F;
            scale.MinorTickMarks.Layout.Width = 0.013F;

            scale.MinPin.EndOffset = 0.01F;
            scale.MinPin.Length = 0.026F;
            scale.MinPin.ScaleOffset = -0.06F;
            scale.MinPin.Width = 0.026F;

            scale.PivotPoint = new PointF(.5f, 2.7f);

            scale.Labels.Layout.Font = new Font("Microsoft Sans Serif", 4F);
            scale.Labels.Layout.ScaleOffset = 0.075F;

            GaugeRange range = new GaugeRange(scale);
            range.Name = "Range1";
            range.ScaleOffset = 0.033F;

            range.StartValue = 0;
            range.StartWidth = 0.07F;
            range.EndValue = 100;
            range.EndWidth = 0.07F;

            range.FillColor.BorderColor = Color.Gray;
            range.FillColor.BorderWidth = 1;
            range.FillColor.Color1 = Color.Yellow;
            range.FillColor.Color2 = Color.Lime;

            scale.Ranges.Add(range);

            GaugePointer pointer = new GaugePointer(scale);
            pointer.Name = "Pointer1";

            pointer.Style = PointerStyle.Needle;
            pointer.ScaleOffset = -0.057F;
            pointer.Width = 0.032F;

            pointer.CapFillColor.BorderColor = Color.DimGray;
            pointer.CapFillColor.BorderWidth = 1;
            pointer.CapFillColor.Color1 = Color.Gainsboro;
            pointer.CapFillColor.Color2 = Color.Silver;

            pointer.FillColor.BorderColor = Color.DimGray;
            pointer.FillColor.BorderWidth = 1;
            pointer.FillColor.Color1 = Color.Black;

            scale.Pointers.Add(pointer);

            _GaugeControl.CircularScales.Add(scale);
        }
Example #2
0
        private void SetCInsetScaleDesignTimeDefaults()
        {
            _GaugeControl.Frame.Style = GaugeFrameStyle.Circular;

            SetBaseGuageColor();

            GaugeCircularScale scale1 = new GaugeCircularScale(_GaugeControl);
            scale1.Name = "Scale1";
            scale1.Radius = 0.092F;
            scale1.Width = 0.139F;

            scale1.MaxValue = 10;
            scale1.Labels.Layout.RotateLabel = false;
            scale1.Labels.Layout.Font = new Font("Microsoft Sans Serif", 18F);

            GradientFillColor fillColor = new GradientFillColor(Color.White);
            fillColor.BorderColor = Color.DimGray;
            fillColor.BorderWidth = 1;

            scale1.MajorTickMarks.Interval = 1;
            scale1.MajorTickMarks.Layout.FillColor = fillColor;
            scale1.MajorTickMarks.Layout.Length = 0.263F;
            scale1.MajorTickMarks.Layout.Style = GaugeMarkerStyle.Circle;
            scale1.MajorTickMarks.Layout.Width = 0.263F;

            scale1.MinorTickMarks.Interval = 0.5;
            scale1.MinorTickMarks.Layout.FillColor = new GradientFillColor(Color.Black);
            scale1.MinorTickMarks.Layout.Length = 0.2F;
            scale1.PivotPoint = new PointF(.50f, .68f);

            GaugePointer pointer = new GaugePointer(scale1);
            pointer.Name = "Pointer1";
            pointer.Style = PointerStyle.Needle;
            pointer.Length = 0.54F;
            pointer.Width = 0.2F;
            pointer.Placement = DisplayPlacement.Near;
            pointer.NeedleStyle = NeedlePointerStyle.Style6;

            pointer.CapFillColor.BorderColor = Color.DimGray;
            pointer.CapFillColor.BorderWidth = 1;
            pointer.CapFillColor.Color1 = Color.WhiteSmoke;
            pointer.CapFillColor.Color2 = Color.Brown;
            pointer.CapFillColor.GradientFillType = GradientFillType.Center;

            pointer.CapStyle = NeedlePointerCapStyle.Style1;
            pointer.CapWidth = 0.4F;

            pointer.FillColor.BorderColor = Color.DarkSlateGray;
            pointer.FillColor.BorderWidth = 1;
            pointer.FillColor.Color1 = Color.Turquoise;

            scale1.Pointers.Add(pointer);

            GaugeSection section = new GaugeSection(scale1);
            section.FillColor.Color1 = Color.CornflowerBlue;
            section.Name = "Section1";

            scale1.Sections.Add(section);

            _GaugeControl.CircularScales.Add(scale1);

            GaugeCircularScale scale2 = new GaugeCircularScale(_GaugeControl);
            scale2.Name = "Scale2";
            scale2.Radius = .38f;

            section = new GaugeSection(scale2);
            section.Name = "Section1";
            section.FillColor = new GradientFillColor(Color.CornflowerBlue, Color.Purple);

            scale2.Sections.Add(section);

            pointer = new GaugePointer(scale2);
            pointer.Name = "Pointer1";
            pointer.Style = PointerStyle.Needle;
            pointer.Length = 0.358F;

            pointer.FillColor = new GradientFillColor(Color.WhiteSmoke, Color.Red);
            pointer.FillColor.BorderColor = Color.DimGray;
            pointer.FillColor.BorderWidth = 1;

            pointer.CapFillColor = new GradientFillColor(Color.WhiteSmoke, Color.DimGray, 90);
            pointer.CapFillColor.BorderColor = Color.DimGray;
            pointer.CapFillColor.BorderWidth = 1;

            scale2.Pointers.Add(pointer);

            _GaugeControl.CircularScales.Add(scale2);
        }