Inheritance: ArcAnnotation
Beispiel #1
0
        private static void FeatherEffectAngularGauge(AngularGauge gauge) {
            gauge.BackgroundAttr.BgColor = Color.White;
            gauge.Axis.UpperLimit = 100;
            gauge.Axis.LowerLimit = 0;
            gauge.BaseFontAttr.FontColor = "#666666".FromHtml();

            gauge.TickMarkAttr.ShowLimits = true;

            gauge.TickMarkAttr.MajorTM.Number = 11;
            gauge.TickMarkAttr.MajorTM.Color = "#666666".FromHtml();
            gauge.TickMarkAttr.MajorTM.Height = 8;

            gauge.TickMarkAttr.MinorTM.Number = 5;
            gauge.TickMarkAttr.MinorTM.Color = "#666666".FromHtml();
            gauge.TickMarkAttr.MinorTM.Height = 3;

            gauge.Border.Show = false;

            gauge.GaugeOuterRadius = 100;
            gauge.GaugeInnerRadius = 90;
            gauge.GaugeOriginX = 170;
            gauge.GaugeOriginY = 170;
            gauge.GaugeScaleAngle = 320;
            // gauge.GaugeStartAngle = 320;

            gauge.TickMarkAttr.TickValueDistance = 10;
            gauge.TickMarkAttr.PlaceValuesInside = true;

            gauge.GaugeFillMix = "";
            gauge.Pivot.Radius = 20;
            gauge.Pivot.FillMix = "{F0EFEA}, {BEBCBO}";
            gauge.Pivot.BorderColor = "#BEBCB0".FromHtml();
            gauge.Pivot.FillRatio = "80, 20";

            gauge.ShowShadow = false;

            gauge.AddColor(0, 80, "#00FF00".FromHtml(), null).Alpha = 0;
            gauge.AddColor(80, 100, "#FF0000".FromHtml(), "Danger").Alpha = 50;

            var dial = gauge.AddDial(null, 65);

            dial.BgColor = "BEBCB0, F0EFEA, BEBCB0";
            dial.Border.Color = Color.White;
            dial.Border.Alpha = 0;
            dial.BaseWidth = 10;
            dial.TopWidth = 3;

            var annGrp = gauge.AddAnnotationGroup(170, 170);

            var ca = new CircleAnnotation { X = 0, Y = 0, Radius = 150 };
            ca.Border.Color = "#BEBCB0".FromHtml();
            ca.FillColor = "F0EFEA, BEBCB0";
            ca.FillRatio = "85,15";
            ca.FillPattern = FillMethod.Linear;
            annGrp.Add(ca);

            ca = new CircleAnnotation { X = 0, Y = 0, Radius = 120 };
            ca.Border.Color = "#BEBCB0".FromHtml();
            ca.FillColor = "F0EFEA, BEBCB0";
            ca.FillRatio = "85,15";
            annGrp.Add(ca);

            ca = new CircleAnnotation { X = 0, Y = 0, Radius = 100, Color = Color.White.ToHexString() };
            ca.Border.Color = "#F0EFEA".FromHtml();
            annGrp.Add(ca);
        }
        private static void BuildAnnotations(WidgetBase widget) {
            widget.Annotations.AutoScale = true;

            var annGroup = new AnnotationGroupElement
                           {
                               X = 175,
                               Y = 105
                           };
            var textAnnotation = new TextAnnotation
                                 {
                                     X = 0,
                                     Y = 0,
                                     Label = "Current status",
                                     Color = "666666",
                                     FontAttr = { FontSize = "11" },
                                     Align = FusionTextAlign.Center
                                 };
            annGroup.Add(textAnnotation);
            widget.Annotations.Add(annGroup);

            annGroup = new AnnotationGroupElement
                       {
                           Id = "GrpRED",
                           X = 175,
                           Y = 125,
                           Visible = false
                       };
            var circle = new CircleAnnotation
                         {
                             X = 0,
                             Y = 0,
                             Radius = 10,
                             FillPattern = FillMethod.Radial,
                             Color = "FFBFBF,FF0000",
                             Border = { Show = false }
                         };
            annGroup.Add(circle);
            widget.Annotations.Add(annGroup);

            annGroup = new AnnotationGroupElement
                       {
                           Id = "GrpYELLOW",
                           X = 175,
                           Y = 125,
                           Visible = false
                       };
            circle = new CircleAnnotation
                     {
                         X = 0,
                         Y = 0,
                         Radius = 10,
                         FillPattern = FillMethod.Radial,
                         Color = "FFFF00,BBBB00",
                         Border = { Show = false }
                     };
            annGroup.Add(circle);
            widget.Annotations.Add(annGroup);

            annGroup = new AnnotationGroupElement
                       {
                           Id = "GrpGREEN",
                           X = 175,
                           Y = 125,
                           Visible = false
                       };
            circle = new CircleAnnotation
                     {
                         X = 0,
                         Y = 0,
                         Radius = 10,
                         FillPattern = FillMethod.Radial,
                         Color = "00FF00,339933",
                         Border = { Show = false }
                     };
            annGroup.Add(circle);
            widget.Annotations.Add(annGroup);
        }