Exemple #1
0
        private void InitializeGauge(CircularGauge gaugeModel)
        {
            // Create a data base data table
            DataTable dt = new DataTable();

            dt.Columns.Add("Name");
            dt.Columns.Add("MaxStock");
            dt.Columns.Add("FreeStock");
            dt.Columns.Add("AvailableStock");
            dt.Rows.Add(new Object[] { "T13", 10000, 5000, 8230 });

            // Create  a new data collection from data base table
            GaugeData gauges = new GaugeData();

            foreach (DataRow row in dt.Rows)
            {
                gauges.Minimum = Convert.ToDouble(row["FreeStock"]);
                gauges.Maximum = Convert.ToDouble(row["MaxStock"]);
                gauges.Value   = Convert.ToDouble(row["AvailableStock"]);
            }

            CircularGaugePointer pointer = new CircularGaugePointer();

            pointer.Value = gauges.Value;

            CircularGaugeAxis axis = new CircularGaugeAxis();

            axis.Pointers = new List <CircularGaugePointer>();
            axis.Minimum  = gauges.Minimum;
            axis.Maximum  = gauges.Maximum;
            axis.Pointers.Add(pointer);

            gaugeModel.Axes = new List <CircularGaugeAxis>();
            gaugeModel.Axes.Add(axis);
        }
        public AccelerationCircularGaugeChart(ChartView BaseChart)
        {
            this.BaseChart = BaseChart;
            circularGauge  = InitializeGauge();

            BaseChart.Chart.Title.Text                  = "Accelerometer Circular Gauge";
            BaseChart.Chart.Title.Alignment             = TextAlignment.Center;
            BaseChart.Chart.Title.TextAlign             = TextAlignment.End;
            BaseChart.Chart.SubTitle.Text               = "X Axis";
            BaseChart.Chart.SubTitle.Visible            = true;
            BaseChart.Chart.SubTitle.Font.Size         += 6;
            BaseChart.Chart.Title.Font.Size            += 6;
            BaseChart.Chart.Title.Font.Bold             = true;
            BaseChart.Chart.Axes.Left.Increment         = 0.2;
            BaseChart.Chart.Axes.Left.Labels.Font.Color = Color.FromRgb(110, 110, 110);
            BaseChart.Chart.Axes.Left.Labels.Font.Size += 7;
            BaseChart.HorizontalOptions                 = LayoutOptions.FillAndExpand;
            BaseChart.VerticalOptions = LayoutOptions.FillAndExpand;

            if (Device.RuntimePlatform != Device.UWP)
            {
                InitializeAccelerometer();
            }

            BaseChart.Chart.Series.Add(circularGauge);
        }
Exemple #3
0
        public override void SetupGaugeCore(ASPxGaugeControl gaugeContainer)
        {
            CircularGauge circularGauge = (CircularGauge)gaugeContainer.AddGauge(GaugeType.Circular);

            // Add the default elements (a scale, background layer, needle and spindle cap).
            circularGauge.AddDefaultElements();
            // Change the background layer's paint style.
            ArcScaleBackgroundLayer backgroundCircular = circularGauge.BackgroundLayers[0];

            backgroundCircular.ShapeType = BackgroundLayerShapeType.CircularFull_Style3;
            // Customize the scale's settings.
            ArcScaleComponent scaleCircular = circularGauge.Scales[0];

            BindableComponent                            = scaleCircular;
            scaleCircular.MinValue                       = 0;
            scaleCircular.MaxValue                       = 100;
            scaleCircular.Value                          = 0;
            scaleCircular.MajorTickCount                 = 6;
            scaleCircular.MajorTickmark.FormatString     = "{0:F0}";
            scaleCircular.MajorTickmark.ShapeType        = TickmarkShapeType.Circular_Style2_2;
            scaleCircular.MajorTickmark.ShapeOffset      = -9;
            scaleCircular.MajorTickmark.AllowTickOverlap = true;
            scaleCircular.MinorTickCount                 = 3;
            scaleCircular.MinorTickmark.ShapeType        = TickmarkShapeType.Circular_Style2_1;
            // Change the needle's paint style.
            ArcScaleNeedleComponent needle = circularGauge.Needles[0];

            needle.ShapeType = NeedleShapeType.CircularFull_Style3;
        }
        public BasicCircularGaugeChart(ChartView BaseChart)
        {
            circularGauge = new CircularGauge();
            var           = new Variables.Variables();


            BaseChart.Chart.Series.Add(circularGauge);

            BaseChart.Chart.Title.Visible = false;

            //circularGauge.GaugeColorPalette = var.GetPaletteBasic;
            circularGauge.MinorTicks.Visible = false;
            circularGauge.Title                      = "Basic Circular Gauge";
            circularGauge.Ticks.Visible              = false;
            circularGauge.HandDistance               = 70;
            circularGauge.HandOffset                 = 0;
            circularGauge.Hand.HorizSize             = 6;
            circularGauge.Hand.Color                 = var.GetPaletteBasic[0];
            circularGauge.Hand.Draw3D                = false;
            circularGauge.Hand.Pen.Visible           = false;
            circularGauge.Hand.Gradient.Visible      = false;
            circularGauge.Hand.Shadow.Visible        = false;
            circularGauge.Center.Color               = var.GetPaletteBasic[0];
            circularGauge.Center.Gradient.Visible    = false;
            circularGauge.Center.HorizSize           = 15;
            circularGauge.Center.VertSize            = 15;
            circularGauge.Center.Draw3D              = false;
            circularGauge.Center.Pen.Visible         = false;
            circularGauge.Center.Shadow.Visible      = false;
            circularGauge.FaceBrush.Color            = Color.White;
            circularGauge.FaceBrush.Visible          = true;
            circularGauge.FaceBrush.Solid            = true;
            circularGauge.FaceBrush.Gradient.Visible = false;
            circularGauge.FaceBrush.ForegroundColor  = Color.White;
            circularGauge.RotateLabels               = false;
            circularGauge.RedLine.Visible            = false;
            circularGauge.GreenLine.Visible          = false;
            circularGauge.Frame.TotalAngle           = 290;
            circularGauge.Frame.Visible              = true;
            circularGauge.Frame.FrameElementPercents = new double[3] {
                0, 100, 0
            };
            circularGauge.Frame.MiddleBand.Color            = Color.FromArgb(190, 190, 190);
            circularGauge.Frame.OuterBand.Visible           = false;
            circularGauge.Frame.InnerBand.Visible           = false;
            circularGauge.Frame.MiddleBand.Solid            = true;
            circularGauge.Frame.MiddleBand.Gradient.Visible = false;
            circularGauge.Frame.RotationAngle = 305;
            circularGauge.Frame.Circled       = true;
            circularGauge.Frame.Width         = 2;
            circularGauge.CircleBackColor     = Color.White;
            circularGauge.Color = Color.White;
            circularGauge.Axis.Labels.Font.Color = Color.Black;
            circularGauge.Value          = 65;
            circularGauge.Maximum        = 100;
            circularGauge.Axis.Increment = 10;
        }
Exemple #5
0
        private void circularGauge1_Loaded(object sender, RoutedEventArgs e)
        {
            Double           sum  = 0;
            MyDataCollection coll = this.FindResource("SeriesData1") as MyDataCollection;
            int i = 1;

            grid.Model[i, 1].CellValue           = "Year";
            grid.Model[i, 1].HorizontalAlignment = HorizontalAlignment.Center;
            grid.Model[i, 1].Background          = Brushes.Pink;
            grid.Model[i, 1].Font.FontWeight     = FontWeights.Bold;
            grid.Model[i, 2].CellValue           = "Revenue of the Year($ 1000)";
            grid.Model[i, 2].HorizontalAlignment = HorizontalAlignment.Center;
            grid.Model[i, 2].Background          = Brushes.Pink;
            grid.Model[i, 2].Font.FontWeight     = FontWeights.Bold;

            i++;
            if (coll != null)
            {
                foreach (MyData d in coll)
                {
                    sum += d.Y1;
                    grid.Model[i, 1].CellValue           = d.Year;
                    grid.Model[i, 1].HorizontalAlignment = HorizontalAlignment.Center;
                    grid.Model[i, 1].Background          = Brushes.Pink;
                    grid.Model[i, 1].Font.FontWeight     = FontWeights.Bold;

                    grid.Model[i, 2].CellValue           = "$" + d.Y1;
                    grid.Model[i, 2].HorizontalAlignment = HorizontalAlignment.Center;
                    grid.Model[i, 2].Background          = Brushes.Pink;
                    grid.Model[i, 2].Font.FontWeight     = FontWeights.Bold;

                    i++;
                }
            }
            grid.Model[i, 1].CellValue           = "Gauge indicating Average sales during the year 2003-2007";
            grid.Model[i, 1].HorizontalAlignment = HorizontalAlignment.Center;
            grid.Model[i, 1].Font.FontWeight     = FontWeights.Bold;

            CircularGauge cg = (sender as UserControl).Content as CircularGauge;

            _circulargauge = cg;
            CircularScale cs = cg.FindName("m_scale") as CircularScale;

            if (cs != null)
            {
                _circularpointer     = cs.Pointers[0];
                cs.Pointers[0].Value = sum / 5;
            }

            CircularPointer cp = cg.FindName("pointer1") as CircularPointer;

            if (cp != null)
            {
                cp.ValueChanged += new PropertyChangedCallback(cp_ValueChanged);
            }
        }
        public MainPage()
        {
            InitializeComponent();

            _chartView          = InitializeChartView();
            _circularGauge      = InitializeCircularGauge();
            _accelerationVector = AccelerationVector.X;

            stkChart.Children.Add(_chartView);
        }
Exemple #7
0
 private void InitializeChart()
 {
     tChart1.Series.Add(cGauge  = new CircularGauge());
     cGauge.LinearGauge.Visible = true;
     cGauge.Value = 1;
     cGauge.Axis.Labels.Font.Size  = 7;
     cGauge.Axis.Labels.Font.Color = CustomGauge.GetGaugePaletteColor(20, cGauge.GaugeColorPalette);
     cGauge.TotalAngle             = 280;
     timer1.Interval = 10;
     timer2.Interval = 500;
 }
Exemple #8
0
        public ActionResult Index()
        {
            //Initialize the chart model
            CircularGauge gaugeModel = new CircularGauge();

            // Add the required properties for chart using the following method
            InitializeGauge(gaugeModel);
            // Store the chart model
            ViewData["GaugeModel"] = gaugeModel;
            return(View());
        }
    private void CreateCircularGauge()
    {
        ASPxGaugeControl gaugeControl = new ASPxGaugeControl();
        CircularGauge    gauge        = (CircularGauge)gaugeControl.AddGauge(GaugeType.Circular);

        gauge.AddDefaultElements();
        ArcScaleComponent scale = gauge.Scales[0];

        scale.BeginUpdate();
        scale.Ranges.AddRange(CreateRanges(scale.MaxValue - scale.MinValue, scale.MinValue));
        scale.EndUpdate();
        Page.Form.Controls.Add(gaugeControl);
    }
Exemple #10
0
 private void InitializeChart()
 {
     tChart1.Series.Add(cGauge   = new CircularGauge());
     cGauge.DisplayTotalAngle    = 180;
     cGauge.DisplayRotationAngle = -90;
     cGauge.TotalAngle           = 150;
     cGauge.RotationAngle        = 90;
     cGauge.Value = 1;
     cGauge.Axis.Labels.Font.Size      = 7;
     cGauge.Axis.Labels.Font.Color     = CustomGauge.GetGaugePaletteColor(20, cGauge.GaugeColorPalette);
     cGauge.FaceBrush.Color            = Color.FromArgb(255, 255, 192);
     cGauge.FaceBrush.Gradient.Visible = false;
     timer1.Enabled = true;
 }
Exemple #11
0
        void CreateGaugeFromCode(Theme theme)
        {
            gaugeControl      = new GaugeControl();
            gaugeControl.Size = new System.Drawing.Size(200, 200);

            circularGauge = gaugeControl.AddCircularGauge();
            circularGauge.AddDefaultElements();

            var style = StyleLoader.Load("Circular", theme.Name, "Full");

            if (style != null)
            {
                style.Apply(circularGauge);
            }
        }
        private BaseGauge BuildCircularGauge(IGaugeItem gaugeItem)
        {
            CircularGauge circularGauge = new CircularGauge();

            circularGauge.GaugeItem = gaugeItem;

            BuildGauge(gaugeItem, (sensor) =>
            {
                circularGauge.SensorItem = sensor;
            });

            // Add it to the page
            this.CanvasGrid.Children.Add(circularGauge);
            return(circularGauge);
        }
Exemple #13
0
        public CircularGaugeChart(ActualWeather weather)
        {
            double max = 0, min = 0;

            foreach (var item in weather.LstWeather)
            {
                if (item.WindSpeed > max)
                {
                    max = item.WindSpeed;
                }
                if (item.WindSpeed < min)
                {
                    min = item.WindSpeed;
                }
            }

            wndSpeedGauge = new CircularGauge(chartView.Chart);

            chartView.Chart.Header.Font.Size       = 10;
            chartView.Chart.Title.Alignment        = TextAlignment.Start;
            chartView.Chart.Header.TextAlign       = TextAlignment.Center;
            chartView.Chart.Header.Size.Height     = 50;
            chartView.Chart.Panel.Gradient.Visible = false;

            wndSpeedGauge.MinorTicks.Visible  = true;
            wndSpeedGauge.Minimum             = min;
            wndSpeedGauge.Maximum             = 10;
            wndSpeedGauge.GreenLineStartValue = 0;
            wndSpeedGauge.GreenLineEndValue   = max - max * 0.2;
            wndSpeedGauge.RedLineStartValue   = max - max * 0.2;
            wndSpeedGauge.RedLineEndValue     = max + max * 0.1;
            wndSpeedGauge.TotalAngle          = 300;
            //wndSpeedGauge.Axis.Increment = 10;
            wndSpeedGauge.Frame.InnerBand.Gradient.Visible  = false;
            wndSpeedGauge.Frame.OuterBand.Gradient.Visible  = false;
            wndSpeedGauge.Frame.MiddleBand.Gradient.Visible = false;

            wndSpeedGauge.FaceBrush.Gradient.Visible = false;
            wndSpeedGauge.FaceBrush.Color            = Color.White;
            wndSpeedGauge.CircleBackColor            = Color.White;

            chartView.Chart.Panel.Color = Color.FromHex("#46BBBD");

            chartView.Chart.Axes.Left.Labels.Font.Color            = Color.Black;
            chartView.Chart.Axes.Left.Labels.Font.Gradient.Visible = false;
            chartView.Chart.Axes.Left.Increment = 1;
        }
Exemple #14
0
        private void InitializeChart()
        {
            tChart1.Aspect.View3D = false;
            series1 = new CircularGauge(tChart1.Chart);

            GaugeSeriesPointer pointer = (GaugeSeriesPointer)series1.GreenLine.Clone();

            pointer.Gradient.Visible = false;
            pointer.Color            = Color.DarkGoldenrod;
            series1.ColorLines.Add(pointer);
            series1.ColorLineStartValues.Add(50);
            series1.ColorLineEndValues.Add(70);

            series1.GreenLineEndValue = 40;

            series1.FillSampleValues();
        }
Exemple #15
0
        private void InitializeChart()
        {
            tChart1.Series.Add(cGauge     = new CircularGauge());
            cGauge.RotationAngle          = 270;
            cGauge.TotalAngle             = 180;
            cGauge.Axis.Labels.Font.Size  = 7;
            cGauge.Axis.Labels.Font.Color = CustomGauge.GetGaugePaletteColor(20, cGauge.GaugeColorPalette);
            cGauge.RedLine.Visible        = false;
            cGauge.GreenLine.Visible      = false;
            cGauge.BeforeDrawHand        += new PaintChartEventHandler(cGauge_BeforeDrawHand);
            cGauge.Value = 1;

            timer1.Enabled = true;

            SetUpNGauge();
            SetUpLGauge();
        }
        public MainPage()
        {
            InitializeComponent();

            this.CurrentPage = xContentPage;

            InitializePages(ChartX);
            InitializePages(ChartY);
            InitializePages(ChartZ);

            circularGaugeX = InitializeGauge();
            circularGaugeY = InitializeGauge();
            circularGaugeZ = InitializeGauge();

            InitializeAccelerometer();

            ChartX.Chart.Series.Add(circularGaugeX);
            ChartY.Chart.Series.Add(circularGaugeY);
            ChartZ.Chart.Series.Add(circularGaugeZ);
        }
        /// <summary>
        /// Create series
        /// </summary>
        /// <returns>CircularGauge</returns>
        private CircularGauge InitializeCircularGauge()
        {
            CircularGauge gauge = new CircularGauge(_chartView.Chart);

            gauge.Title                            = "Accelerometer Circular Gauge";
            gauge.Maximum                          = 1;
            gauge.Minimum                          = -1;
            gauge.GreenLine.Visible                = false;
            gauge.RedLine.Visible                  = false;
            gauge.Frame.Width                      = 1;
            gauge.Hand.Gradient.Visible            = false;
            gauge.Hand.Color                       = Color.FromRgb(170, 170, 170);
            gauge.HandOffset                       = 0;
            gauge.Hand.Style                       = PointerStyles.DownTriangle;
            gauge.Hand.HorizSize                  += 10;
            gauge.Center.Gradient.Visible          = false;
            gauge.Center.Color                     = Color.FromRgb(170, 170, 170);
            gauge.Center.Shadow.Visible            = false;
            gauge.Center.HorizSize                += 10;
            gauge.Center.VertSize                 += 10;
            gauge.FaceBrush.Color                  = Color.White;
            gauge.FaceBrush.Gradient.Visible       = false;
            gauge.Hand.HorizSize                  += 4;
            gauge.Hand.VertSize                   += 4;
            gauge.Ticks.VertSize                   = 10;
            gauge.Ticks.HorizSize                  = 2;
            gauge.MinorTicks.Visible               = true;
            gauge.MinorTickDistance                = 3;
            gauge.MinorTicks.HorizSize             = 1;
            gauge.MinorTicks.VertSize              = 5;
            gauge.Ticks.Pen.Visible                = false;
            gauge.Ticks.Color                      = Color.FromRgb(140, 140, 140);
            gauge.RotateLabels                     = false;
            gauge.Frame.OuterBand.Visible          = false;
            gauge.Frame.MiddleBand.Visible         = false;
            gauge.Frame.InnerBand.Visible          = true;
            gauge.Frame.InnerBand.Gradient.Visible = false;
            gauge.Frame.InnerBand.Color            = Color.FromRgb(120, 120, 120);

            return(gauge);
        }
        /// <summary>
        /// The initialize chart.
        /// </summary>
        private void InitializeChart()
        {
            this.ChartControl.HorizontalAlignment     = System.Windows.HorizontalAlignment.Stretch;
            this.ChartControl.VerticalAlignment       = System.Windows.VerticalAlignment.Stretch;
            this.ChartControl.Header.Visible          = false;
            this.ChartControl.Legend.Visible          = false;
            this.ChartControl.Chart.Title.Visible     = false;
            this.ChartControl.Aspect.View3D           = false;
            this.ChartControl.Walls.Back.Transparency = 100;
            this.ChartControl.Axes.Left.Increment     = 1;
            var series = new CircularGauge {
                Title = "Values", RedLineStartValue = 10, RedLineEndValue = 15, GreenLineStartValue = 0, GreenLineEndValue = 5
            };

            series.ShowInLegend = false;
            series.Minimum      = 0;
            series.Maximum      = 15;
            series.Clear();
            series.Value = 0;
            this.ChartControl.Series.Add(series);
        }
        /////////////////////////////////////////////////////////////////////////////////////////////////////
        // NON-PUBLIC PROCEDURES
        /////////////////////////////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Called when the control has loaded.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void OnLoaded(object sender, EventArgs e)
        {
            // Create the main CircularGauge and add it to the target panel
            CircularGauge circularGauge = new CircularGauge()
            {
                Width  = 220,
                Height = 220,
                Radius = 110,
                HorizontalAlignment       = HorizontalAlignment.Center,
                Background                = new SolidColorBrush(Color.FromArgb(0xff, 0xee, 0xee, 0xe3)),
                RimBrush                  = new SolidColorBrush(Color.FromArgb(0xff, 0xf4, 0xf3, 0xf8)),
                FrameType                 = CircularFrameType.CircularGear,
                IsBackgroundEffectEnabled = false,
            };

            this.targetPanel.Children.Insert(0, circularGauge);

            // Create and add a CircularScale to the CircularGauge
            CircularScale circularScale = new CircularScale()
            {
                Radius     = 75,
                StartAngle = 30,
                SweepAngle = 330,
                BarExtent  = 1
            };

            circularGauge.Scales.Add(circularScale);

            // Create and add a CircularTickSet to the CircularScale
            CircularTickSet circularTickSet = new CircularTickSet()
            {
                MajorInterval = 10,
                MinorInterval = 2
            };

            circularScale.TickSets.Add(circularTickSet);

            // Create and add two CircularRanges to the CircularTickSet
            circularTickSet.Ranges.Add(new CircularRange()
            {
                ScalePlacement = ScalePlacement.Inside,
                StartValue     = 80,
                EndValue       = 100,
                HasDropShadow  = false,
                StartExtent    = 15,
                EndExtent      = 15,
                Background     = LinearGradientBrushExtension.CreateBrush(Colors.Red, Colors.DarkRed, LinearGradientType.LeftToRight),
            });
            circularTickSet.Ranges.Add(new CircularRange()
            {
                ScalePlacement = ScalePlacement.Inside,
                StartValue     = 0,
                EndValue       = 20,
                HasDropShadow  = false,
                StartExtent    = 15,
                EndExtent      = 15,
                Background     = LinearGradientBrushExtension.CreateBrush(Colors.Green, Colors.DarkGreen, LinearGradientType.LeftToRight)
            });

            // Create and add a CircularTickMarkMajor and CircularTickMarkMinor to the CircularTickSet
            circularTickSet.Ticks.Add(new CircularTickMarkMajor()
            {
                TickMarkExtent = 10,
                TickMarkAscent = 4,
                TickMarkType   = TickMarkType.SwordBlunt,
                Background     = LinearGradientBrushExtension.CreateBrush(Colors.Black, Colors.DarkGray, LinearGradientType.TopToBottom)
            });
            circularTickSet.Ticks.Add(new CircularTickMarkMinor()
            {
                TickMarkExtent = 7,
                TickMarkAscent = 4,
                TickMarkType   = TickMarkType.TriangleSharp,
                Background     = LinearGradientBrushExtension.CreateBrush(Colors.Black, Colors.DarkGray, LinearGradientType.TopToBottom)
            });

            // Create and add a CircularTickLabelMajor to the CircularTickSet
            circularTickSet.Ticks.Add(new CircularTickLabelMajor()
            {
                Foreground      = new SolidColorBrush(Color.FromArgb(0xff, 0x0c, 0x09, 0x09)),
                FontSize        = 10,
                ScalePlacement  = ScalePlacement.Outside,
                ScaleOffset     = 5,
                TextOrientation = TextOrientation.Rotated
            });

            // Create and add a CircularPointerNeedle and CircularPointerCap to the CircularTickSet
            CircularPointerNeedle circularPointerNeedle = new CircularPointerNeedle()
            {
                NeedleType    = PointerNeedleType.TriangleSharp,
                PointerExtent = 75,
                PointerAscent = 10,
                Background    = LinearGradientBrushExtension.CreateBrush(Color.FromArgb(0xff, 0xe1, 0x61, 0x79), Color.FromArgb(0xff, 0x9a, 0x12, 0x25), LinearGradientType.LeftToRight),
            };

            circularTickSet.Pointers.Add(circularPointerNeedle);

            // Binding the needle to the value slider
            circularPointerNeedle.SetBinding(CircularPointerNeedle.ValueProperty, new Binding("Value")
            {
                Source = this,
                Mode   = BindingMode.TwoWay
            });

            // Create and add a CircularPointerCap to the CircularTickSet
            circularTickSet.Pointers.Add(new CircularPointerCap()
            {
                PointerExtent = 25,
                CapType       = PointerCapType.CircleConvex,
                Background    = new SolidColorBrush(Color.FromArgb(0xff, 0x9a, 0x12, 0x25))
            });
        }
        public CarFuelChart(ChartView BaseChart)
        {
            circularGauge = new CircularGauge();
            var           = new Variables.Variables();

            BaseChart.Chart.Series.Add(circularGauge);
            //BaseChart.Chart.AfterDraw += Chart_AfterDraw;
            BaseChart.Chart.Title.Visible = false;

            //circularGauge.GaugeColorPalette = var.GetPaletteBasic;
            circularGauge.Title = "Car Fuel";
            circularGauge.MinorTicks.Visible     = true;
            circularGauge.MinorTickDistance      = 2;
            circularGauge.MinorTicks.Color       = Xamarin.Forms.Color.White;
            circularGauge.MinorTicks.VertSize    = 4;
            circularGauge.MinorTicks.HorizSize   = 3;
            circularGauge.MinorTicks.Pen.Visible = false;
            //circularGauge.MinorTicks.SizeDouble = 5;
            circularGauge.Ticks.Visible = true;
            circularGauge.Ticks.Color   = Xamarin.Forms.Color.White;

            circularGauge.HandDistance            = 60;
            circularGauge.HandOffset              = 0;
            circularGauge.Hand.HorizSize          = 10;
            circularGauge.Hand.Color              = Xamarin.Forms.Color.FromRgb(220, 220, 220);
            circularGauge.Hand.Draw3D             = false;
            circularGauge.Hand.Pen.Visible        = false;
            circularGauge.Hand.Gradient.Visible   = false;
            circularGauge.Hand.Shadow.Visible     = true;
            circularGauge.Center.Color            = Xamarin.Forms.Color.FromRgb(220, 220, 220);
            circularGauge.Center.Gradient.Visible = true;
            circularGauge.Center.HorizSize        = 25;
            circularGauge.Center.VertSize         = 25;
            circularGauge.Center.Draw3D           = false;
            circularGauge.Center.Pen.Visible      = true;
            circularGauge.Center.Shadow.Visible   = true;
            //circularGauge.FaceBrush.ForegroundColor = basicColorFaceBrush;
            circularGauge.RotateLabels                  = false;
            circularGauge.RedLine.Visible               = false;
            circularGauge.GreenLine.Visible             = true;
            circularGauge.GreenLine.Gradient.Visible    = true;
            circularGauge.GreenLine.Gradient.UseMiddle  = true;
            circularGauge.GreenLine.Gradient.StartColor = Xamarin.Forms.Color.Red;
            circularGauge.GreenLine.Gradient.EndColor   = Xamarin.Forms.Color.LightGreen;
            circularGauge.GreenLine.Gradient.Direction  = Steema.TeeChart.Drawing.GradientDirection.FromBottomLeft;
            circularGauge.GreenLineStartValue           = 0;
            circularGauge.GreenLineEndValue             = 1;
            circularGauge.GreenLine.InflateMargins      = true;
            circularGauge.Frame.Visible                 = true;
            circularGauge.Frame.FrameElementPercents    = new double[3] {
                0, 60, 40
            };
            circularGauge.Frame.MiddleBand.Color                = Xamarin.Forms.Color.FromRgb(190, 190, 190);
            circularGauge.Frame.OuterBand.Visible               = false;
            circularGauge.Frame.InnerBand.Visible               = true;
            circularGauge.Frame.InnerBand.Gradient.Visible      = false;
            circularGauge.Frame.InnerBand.Solid                 = true;
            circularGauge.Frame.InnerBand.Color                 = Xamarin.Forms.Color.FromRgb(120, 120, 120);
            circularGauge.Frame.MiddleBand.Visible              = false;
            circularGauge.Frame.MiddleBand.Solid                = true;
            circularGauge.Frame.MiddleBand.Gradient.Visible     = true;
            circularGauge.Frame.MiddleBand.Gradient.StartColor  = Xamarin.Forms.Color.FromRgb(100, 100, 100);
            circularGauge.Frame.MiddleBand.Gradient.MiddleColor = Xamarin.Forms.Color.FromRgb(50, 50, 50);
            circularGauge.Frame.MiddleBand.Gradient.EndColor    = Xamarin.Forms.Color.FromRgb(20, 20, 20);
            circularGauge.Frame.MiddleBand.Gradient.Direction   = Steema.TeeChart.Drawing.GradientDirection.DiagonalDown;
            circularGauge.Frame.RotationAngle    = 0;
            circularGauge.Frame.Circled          = true;
            circularGauge.Frame.Width            = 2;
            circularGauge.CircleBackColor        = Xamarin.Forms.Color.White;
            circularGauge.Axis.Labels.Font.Color = Xamarin.Forms.Color.White;
            circularGauge.Maximum                    = 1;
            circularGauge.Axis.Increment             = 0.25;
            circularGauge.Value                      = 0.75;
            circularGauge.TotalAngle                 = 180;
            circularGauge.Hand.Style                 = PointerStyles.DownTriangle;
            circularGauge.FaceBrush.Visible          = false;
            circularGauge.FaceBrush.Solid            = false;
            circularGauge.FaceBrush.Gradient.Visible = false;
            circularGauge.DisplayTotalAngle          = 180;
            circularGauge.CircleBackColor            = Xamarin.Forms.Color.Black;
            circularGauge.Frame.TotalAngle           = 180;

            BaseChart.Chart.Axes.Bottom.Ticks.Transparency = 100;
            //BaseChart.Chart.AfterDraw += Chart_AfterDraw;
        }
        public CustomPointerChart(ChartView BaseChart)
        {
            circularGauge = new CircularGauge();
            var           = new Variables.Variables();
            GaugeSeriesPointer pointer2;

            BaseChart.Chart.Series.Add(circularGauge);
            BaseChart.Chart.Title.Visible  = false;
            BaseChart.Chart.Panning.Active = true;
            BaseChart.Chart.Panning.Allow  = ScrollModes.Both;
            BaseChart.Chart.Zoom.Active    = true;
            BaseChart.Chart.Zoom.Allow     = true;

            pointer2 = new GaugeSeriesPointer(BaseChart.Chart, BaseChart.Chart.Series[0]);

            //circularGauge.GaugeColorPalette = var.GetPaletteBasic;
            circularGauge.Title = "Custom Hand";
            circularGauge.MinorTicks.Visible = false;
            circularGauge.Ticks.Visible      = false;

            circularGauge.Hand.HorizSize        = 20;
            circularGauge.Hand.Color            = Color.Red;
            circularGauge.Hand.Draw3D           = false;
            circularGauge.Hand.Pen.Visible      = false;
            circularGauge.Hand.Shadow.Visible   = false;
            circularGauge.Hand.Style            = PointerStyles.Arrow;
            circularGauge.Hand.Gradient.Visible = false;

            pointer2.HorizSize        = 20;
            pointer2.Color            = Color.FromArgb(30, 70, 230);
            pointer2.Draw3D           = false;
            pointer2.Pen.Visible      = false;
            pointer2.Gradient.Visible = false;
            pointer2.Shadow.Visible   = false;
            pointer2.Style            = PointerStyles.Arrow;
            pointer2.VertSize         = 100;

            circularGauge.HandDistances.Add(80);
            circularGauge.HandOffsets.Add(0);
            circularGauge.HandOffset   = 0;
            circularGauge.HandDistance = 80;

            circularGauge.Hands.Add(pointer2);
            circularGauge.Center.Color               = Color.White;
            circularGauge.Center.Gradient.Visible    = false;
            circularGauge.Center.HorizSize           = 30;
            circularGauge.Center.VertSize            = 30;
            circularGauge.Center.Pen.Color           = Color.White;
            circularGauge.Center.Draw3D              = false;
            circularGauge.Center.Pen.Visible         = true;
            circularGauge.Center.Shadow.Visible      = false;
            circularGauge.Center.Visible             = true;
            circularGauge.FaceBrush.Visible          = true;
            circularGauge.FaceBrush.Solid            = true;
            circularGauge.FaceBrush.Gradient.Visible = false;
            circularGauge.FaceBrush.ForegroundColor  = Color.White;
            circularGauge.FaceBrush.Color            = Color.White;
            circularGauge.RotateLabels               = false;
            circularGauge.RedLine.Visible            = false;
            circularGauge.GreenLine.Visible          = false;
            circularGauge.Frame.TotalAngle           = 180;
            circularGauge.Frame.Visible              = true;
            circularGauge.Frame.FrameElementPercents = new double[3] {
                0, 100, 0
            };
            circularGauge.Frame.MiddleBand.Color              = Color.FromArgb(140, 140, 140);
            circularGauge.Frame.OuterBand.Visible             = false;
            circularGauge.Frame.InnerBand.Visible             = false;
            circularGauge.Frame.MiddleBand.Solid              = true;
            circularGauge.Frame.MiddleBand.Gradient.Visible   = false;
            circularGauge.Frame.MiddleBand.Gradient.Direction = GradientDirection.DiagonalUp;
            circularGauge.Frame.RotationAngle = 0;
            circularGauge.Frame.Circled       = true;
            circularGauge.Frame.Width         = 2;
            circularGauge.Color                  = Color.White;
            circularGauge.CircleBackColor        = Color.White;
            circularGauge.Axis.Labels.Font.Color = Color.Black;
            circularGauge.Maximum                = 10;
            circularGauge.Axis.Increment         = 2;
            circularGauge.Value                  = 6;
            circularGauge.TotalAngle             = 180;

            circularGauge.mandatory[0] = 7;
            circularGauge.mandatory[1] = 2;
        }
Exemple #22
0
 private void InitializeComponent()
 {
     this.pictureBox2                = new PictureBox();
     this.pictureBox1                = new PictureBox();
     this.labelControl1              = new LabelControl();
     this.labelControl2              = new LabelControl();
     this.labelControl3              = new LabelControl();
     this.labelControl4              = new LabelControl();
     this.labelControl5              = new LabelControl();
     this.lbl_Name                   = new LabelControl();
     this.lbl_Number                 = new LabelControl();
     this.lbl_sex                    = new LabelControl();
     this.lbl_age                    = new LabelControl();
     this.lbl_persontype             = new LabelControl();
     this.lbl_channl                 = new LabelControl();
     this.labelControl7              = new LabelControl();
     this.panelControl1              = new PanelControl();
     this.lbl_time                   = new Label();
     this.gaugeControl1              = new GaugeControl();
     this.circularGauge1             = new CircularGauge();
     this.labelComponent1            = new LabelComponent();
     this.labelComponent2            = new LabelComponent();
     this.arcScaleRangeBarComponent1 = new ArcScaleRangeBarComponent();
     this.arcScaleComponent1         = new ArcScaleComponent();
     ((ISupportInitialize)this.pictureBox2).BeginInit();
     ((ISupportInitialize)this.pictureBox1).BeginInit();
     ((ISupportInitialize)this.panelControl1).BeginInit();
     this.panelControl1.SuspendLayout();
     this.circularGauge1.BeginInit();
     this.labelComponent1.BeginInit();
     this.labelComponent2.BeginInit();
     this.arcScaleRangeBarComponent1.BeginInit();
     this.arcScaleComponent1.BeginInit();
     base.SuspendLayout();
     this.pictureBox2.BackColor              = Color.Black;
     this.pictureBox2.BorderStyle            = BorderStyle.FixedSingle;
     this.pictureBox2.Location               = new Point(217, 2);
     this.pictureBox2.Name                   = "pictureBox2";
     this.pictureBox2.Size                   = new Size(211, 226);
     this.pictureBox2.SizeMode               = PictureBoxSizeMode.StretchImage;
     this.pictureBox2.TabIndex               = 0;
     this.pictureBox2.TabStop                = false;
     this.pictureBox1.BackColor              = Color.Black;
     this.pictureBox1.BorderStyle            = BorderStyle.FixedSingle;
     this.pictureBox1.Location               = new Point(3, 2);
     this.pictureBox1.Name                   = "pictureBox1";
     this.pictureBox1.Size                   = new Size(211, 226);
     this.pictureBox1.SizeMode               = PictureBoxSizeMode.StretchImage;
     this.pictureBox1.TabIndex               = 0;
     this.pictureBox1.TabStop                = false;
     this.labelControl1.Appearance.Font      = new Font("微软雅黑", 10.5f, FontStyle.Bold, GraphicsUnit.Point, 134);
     this.labelControl1.Appearance.ForeColor = Color.Silver;
     this.labelControl1.Location             = new Point(217, 16);
     this.labelControl1.Name                 = "labelControl1";
     this.labelControl1.Size                 = new Size(50, 19);
     this.labelControl1.TabIndex             = 3;
     this.labelControl1.Text                 = "姓  名:";
     this.labelControl2.Appearance.Font      = new Font("微软雅黑", 10.5f, FontStyle.Bold, GraphicsUnit.Point, 134);
     this.labelControl2.Appearance.ForeColor = Color.Silver;
     this.labelControl2.Location             = new Point(217, 121);
     this.labelControl2.Name                 = "labelControl2";
     this.labelControl2.Size                 = new Size(50, 19);
     this.labelControl2.TabIndex             = 3;
     this.labelControl2.Text                 = "编  号:";
     this.labelControl2.Click               += new EventHandler(this.labelControl2_Click);
     this.labelControl3.Appearance.Font      = new Font("微软雅黑", 10.5f, FontStyle.Bold, GraphicsUnit.Point, 134);
     this.labelControl3.Appearance.ForeColor = Color.Silver;
     this.labelControl3.Location             = new Point(217, 51);
     this.labelControl3.Name                 = "labelControl3";
     this.labelControl3.Size                 = new Size(50, 19);
     this.labelControl3.TabIndex             = 3;
     this.labelControl3.Text                 = "性  别:";
     this.labelControl4.Appearance.Font      = new Font("微软雅黑", 10.5f, FontStyle.Bold, GraphicsUnit.Point, 134);
     this.labelControl4.Appearance.ForeColor = Color.Silver;
     this.labelControl4.Location             = new Point(217, 156);
     this.labelControl4.Name                 = "labelControl4";
     this.labelControl4.Size                 = new Size(50, 19);
     this.labelControl4.TabIndex             = 3;
     this.labelControl4.Text                 = "年  龄:";
     this.labelControl5.Appearance.Font      = new Font("微软雅黑", 10.5f, FontStyle.Bold, GraphicsUnit.Point, 134);
     this.labelControl5.Appearance.ForeColor = Color.Silver;
     this.labelControl5.Location             = new Point(217, 86);
     this.labelControl5.Name                 = "labelControl5";
     this.labelControl5.Size                 = new Size(50, 19);
     this.labelControl5.TabIndex             = 3;
     this.labelControl5.Text                 = "类  别:";
     this.lbl_Name.Appearance.Font           = new Font("微软雅黑", 10.5f, FontStyle.Bold, GraphicsUnit.Point, 134);
     this.lbl_Name.Appearance.ForeColor      = Color.Silver;
     this.lbl_Name.Location                  = new Point(286, 16);
     this.lbl_Name.Name                   = "lbl_Name";
     this.lbl_Name.Size                   = new Size(28, 19);
     this.lbl_Name.TabIndex               = 4;
     this.lbl_Name.Text                   = "张三";
     this.lbl_Number.Appearance.Font      = new Font("微软雅黑", 10.5f, FontStyle.Bold, GraphicsUnit.Point, 134);
     this.lbl_Number.Appearance.ForeColor = Color.Silver;
     this.lbl_Number.Location             = new Point(286, 121);
     this.lbl_Number.Name                 = "lbl_Number";
     this.lbl_Number.Size                 = new Size(117, 19);
     this.lbl_Number.TabIndex             = 4;
     this.lbl_Number.Text                 = "2220124555555";
     this.lbl_Number.Click               += new EventHandler(this.lbl_Number_Click);
     this.lbl_sex.Appearance.Font         = new Font("微软雅黑", 10.5f, FontStyle.Bold, GraphicsUnit.Point, 134);
     this.lbl_sex.Appearance.ForeColor    = Color.Silver;
     this.lbl_sex.Location                = new Point(286, 51);
     this.lbl_sex.Name                                  = "lbl_sex";
     this.lbl_sex.Size                                  = new Size(14, 19);
     this.lbl_sex.TabIndex                              = 4;
     this.lbl_sex.Text                                  = "男";
     this.lbl_age.Appearance.Font                       = new Font("微软雅黑", 10.5f, FontStyle.Bold, GraphicsUnit.Point, 134);
     this.lbl_age.Appearance.ForeColor                  = Color.Silver;
     this.lbl_age.Location                              = new Point(286, 156);
     this.lbl_age.Name                                  = "lbl_age";
     this.lbl_age.Size                                  = new Size(18, 19);
     this.lbl_age.TabIndex                              = 4;
     this.lbl_age.Text                                  = "19";
     this.lbl_persontype.Appearance.Font                = new Font("微软雅黑", 10.5f, FontStyle.Bold, GraphicsUnit.Point, 134);
     this.lbl_persontype.Appearance.ForeColor           = Color.Silver;
     this.lbl_persontype.Location                       = new Point(286, 86);
     this.lbl_persontype.Name                           = "lbl_persontype";
     this.lbl_persontype.Size                           = new Size(52, 19);
     this.lbl_persontype.TabIndex                       = 4;
     this.lbl_persontype.Text                           = "VIP客户";
     this.lbl_channl.Appearance.Font                    = new Font("微软雅黑", 10.5f, FontStyle.Bold, GraphicsUnit.Point, 134);
     this.lbl_channl.Appearance.ForeColor               = Color.Silver;
     this.lbl_channl.Location                           = new Point(286, 191);
     this.lbl_channl.Name                               = "lbl_channl";
     this.lbl_channl.Size                               = new Size(37, 19);
     this.lbl_channl.TabIndex                           = 3;
     this.lbl_channl.Text                               = "通道1";
     this.labelControl7.Appearance.Font                 = new Font("微软雅黑", 10.5f, FontStyle.Bold, GraphicsUnit.Point, 134);
     this.labelControl7.Appearance.ForeColor            = Color.Silver;
     this.labelControl7.Location                        = new Point(217, 191);
     this.labelControl7.Name                            = "labelControl7";
     this.labelControl7.Size                            = new Size(70, 19);
     this.labelControl7.TabIndex                        = 4;
     this.labelControl7.Text                            = "识别通道:";
     this.panelControl1.Anchor                          = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
     this.panelControl1.Appearance.BackColor            = Color.Transparent;
     this.panelControl1.Appearance.Options.UseBackColor = true;
     this.panelControl1.BorderStyle                     = BorderStyles.Simple;
     this.panelControl1.Controls.Add(this.lbl_time);
     this.panelControl1.Controls.Add(this.gaugeControl1);
     this.panelControl1.Controls.Add(this.labelControl4);
     this.panelControl1.Controls.Add(this.labelControl7);
     this.panelControl1.Controls.Add(this.labelControl1);
     this.panelControl1.Controls.Add(this.lbl_persontype);
     this.panelControl1.Controls.Add(this.labelControl2);
     this.panelControl1.Controls.Add(this.lbl_age);
     this.panelControl1.Controls.Add(this.labelControl3);
     this.panelControl1.Controls.Add(this.lbl_sex);
     this.panelControl1.Controls.Add(this.labelControl5);
     this.panelControl1.Controls.Add(this.lbl_Number);
     this.panelControl1.Controls.Add(this.lbl_Name);
     this.panelControl1.Controls.Add(this.lbl_channl);
     this.panelControl1.Location = new Point(4, 233);
     this.panelControl1.Name     = "panelControl1";
     this.panelControl1.Size     = new Size(424, 239);
     this.panelControl1.TabIndex = 5;
     this.lbl_time.AutoSize      = true;
     this.lbl_time.Font          = new Font("微软雅黑", 10.5f, FontStyle.Bold);
     this.lbl_time.ForeColor     = Color.Silver;
     this.lbl_time.Location      = new Point(15, 215);
     this.lbl_time.Name          = "lbl_time";
     this.lbl_time.Size          = new Size(159, 19);
     this.lbl_time.TabIndex      = 6;
     this.lbl_time.Text          = "2017-12-25 13:18:85";
     this.gaugeControl1.set_AutoLayout(false);
     this.gaugeControl1.BackColor = Color.Transparent;
     this.gaugeControl1.set_BorderStyle(BorderStyles.NoBorder);
     this.gaugeControl1.get_Gauges().AddRange(new IGauge[]
     {
         this.circularGauge1
     });
     this.gaugeControl1.Location = new Point(4, 16);
     this.gaugeControl1.Name     = "gaugeControl1";
     this.gaugeControl1.Size     = new Size(207, 196);
     this.gaugeControl1.TabIndex = 7;
     this.circularGauge1.set_Bounds(new Rectangle(2, 3, 195, 184));
     this.circularGauge1.get_Labels().AddRange(new LabelComponent[]
     {
         this.labelComponent1,
         this.labelComponent2
     });
     this.circularGauge1.set_Name("circularGauge1");
     this.circularGauge1.get_RangeBars().AddRange(new ArcScaleRangeBarComponent[]
     {
         this.arcScaleRangeBarComponent1
     });
     this.circularGauge1.get_Scales().AddRange(new ArcScaleComponent[]
     {
         this.arcScaleComponent1
     });
     this.labelComponent1.get_AppearanceText().set_Font(new Font("Segoe UI", 27.75f));
     this.labelComponent1.set_Name("circularGauge1_Label1");
     this.labelComponent1.set_Shader(new StyleShader("Colors[Style1:OrangeRed;Style2:OrangeRed]"));
     this.labelComponent1.set_Size(new SizeF(140f, 60f));
     this.labelComponent1.set_Text("910");
     this.labelComponent1.set_UseColorScheme(false);
     this.labelComponent1.set_ZOrder(-1001);
     this.labelComponent2.get_AppearanceText().set_Font(new Font("Tahoma", 15f));
     this.labelComponent2.get_AppearanceText().set_TextBrush(new SolidBrushObject("Color:Black"));
     this.labelComponent2.set_Name("circularGauge1_Label2");
     this.labelComponent2.set_Position(new PointF2D(125f, 175f));
     this.labelComponent2.set_Shader(new StyleShader("Colors[Style1:White;Style2:White]"));
     this.labelComponent2.set_Text("相似度");
     this.labelComponent2.set_ZOrder(-1001);
     this.arcScaleRangeBarComponent1.set_ArcScale(this.arcScaleComponent1);
     this.arcScaleRangeBarComponent1.set_Name("circularGauge1_RangeBar2");
     this.arcScaleRangeBarComponent1.set_RoundedCaps(true);
     this.arcScaleRangeBarComponent1.set_Shader(new StyleShader("Colors[Style1:OrangeRed;Style2:OrangeRed]"));
     this.arcScaleRangeBarComponent1.set_ShowBackground(true);
     this.arcScaleRangeBarComponent1.set_StartOffset(80f);
     this.arcScaleRangeBarComponent1.set_ZOrder(-10);
     this.arcScaleComponent1.get_AppearanceMajorTickmark().set_BorderBrush(new SolidBrushObject("Color:White"));
     this.arcScaleComponent1.get_AppearanceMajorTickmark().set_ContentBrush(new SolidBrushObject("Color:White"));
     this.arcScaleComponent1.get_AppearanceMinorTickmark().set_BorderBrush(new SolidBrushObject("Color:White"));
     this.arcScaleComponent1.get_AppearanceMinorTickmark().set_ContentBrush(new SolidBrushObject("Color:White"));
     this.arcScaleComponent1.get_AppearanceTickmarkText().set_Font(new Font("Tahoma", 8.5f));
     this.arcScaleComponent1.get_AppearanceTickmarkText().set_TextBrush(new SolidBrushObject("Color:#484E5A"));
     this.arcScaleComponent1.set_Center(new PointF2D(125f, 125f));
     this.arcScaleComponent1.set_EndAngle(90f);
     this.arcScaleComponent1.set_MajorTickCount(0);
     this.arcScaleComponent1.get_MajorTickmark().set_FormatString("{0:F0}");
     this.arcScaleComponent1.get_MajorTickmark().set_ShapeOffset(-14f);
     this.arcScaleComponent1.get_MajorTickmark().set_ShapeType(67);
     this.arcScaleComponent1.get_MajorTickmark().set_TextOrientation(3);
     this.arcScaleComponent1.set_MaxValue(100f);
     this.arcScaleComponent1.set_MinorTickCount(0);
     this.arcScaleComponent1.get_MinorTickmark().set_ShapeOffset(-7f);
     this.arcScaleComponent1.get_MinorTickmark().set_ShapeType(68);
     this.arcScaleComponent1.set_Name("scale1");
     this.arcScaleComponent1.set_StartAngle(-270f);
     this.arcScaleComponent1.set_Value(20f);
     base.AutoScaleMode = AutoScaleMode.None;
     this.BackColor     = Color.FromArgb(45, 45, 48);
     base.Controls.Add(this.panelControl1);
     base.Controls.Add(this.pictureBox2);
     base.Controls.Add(this.pictureBox1);
     this.Font = new Font("微软雅黑", 9f, FontStyle.Regular, GraphicsUnit.Point, 134);
     base.Name = "FaceCompareUserControl3";
     base.Size = new Size(431, 475);
     ((ISupportInitialize)this.pictureBox2).EndInit();
     ((ISupportInitialize)this.pictureBox1).EndInit();
     ((ISupportInitialize)this.panelControl1).EndInit();
     this.panelControl1.ResumeLayout(false);
     this.panelControl1.PerformLayout();
     this.circularGauge1.EndInit();
     this.labelComponent1.EndInit();
     this.labelComponent2.EndInit();
     this.arcScaleRangeBarComponent1.EndInit();
     this.arcScaleComponent1.EndInit();
     base.ResumeLayout(false);
 }
Exemple #23
0
    /// <summary>
    /// 주요지표 스키마 추가 및 데이터 바인딩
    /// YMD | E | G | W | A | 매출액 | 공급량 | ...
    /// </summary>
    /// <returns></returns>
    //public DataTable GetGradeSchema(DataTable iDt)
    //{
    //    DateTime startYM = (DateTime.ParseExact(this.IYmd, "yyyyMM", null)).AddYears(-1);
    //    DataTable dtGrade = iDt;
    //    Biz_Bsc_Kpi_Dashboard objTC = new Biz_Bsc_Kpi_Dashboard();
    //    DataSet dsGrade = objTC.GetDashBoardKpiList(this.IEstTermRefID);
    //    DataRow drGrade = null;

    //    iRow = dsGrade.Tables[0].Rows.Count;
    //    for (int i = 0; i < iRow; i++)
    //    {
    //            DataColumn dc = dtGrade.Columns.Add(dsGrade.Tables[0].Rows[i]["KPI_REF_ID"].ToString(), typeof(decimal));
    //            dc.Caption    = dsGrade.Tables[0].Rows[i]["NAME_KNAME"].ToString();
    //    }

    //    DataSet actDs = new DataSet();

    //    string sKpiNm   = "";
    //    string sUnitNm  = "";
    //    decimal dTarget = 0;
    //    decimal dResult = 0;
    //    double dAVRate  = 0;
    //    string sColT = (this.ISumType == "MS") ? "TARGET_MS" : "TARGET_TS";
    //    string sColR = (this.ISumType == "MS") ? "RESULT_MS" : "RESULT_TS";
    //    string sColA = (this.ISumType == "MS") ? "ACHV_RATE_MS" : "ACHV_RATE_TS";

    //    if (dsGrade.Tables.Count > 0)
    //    {
    //        iRow = dsGrade.Tables[0].Rows.Count;
    //        for (int i = 0; i < iRow; i++)
    //        {
    //            this.IKpiRefID = int.Parse(dsGrade.Tables[0].Rows[i]["KPI_REF_ID"].ToString());
    //            actDs = objTC.GetDashBoardForKpiAnalysis( this.IEstTermRefID, this.IKpiRefID
    //                                                    , base.GetYMDFromDateTime(startYM, "").Substring(0, 6)
    //                                                    , this.IYmd, this.ISumType);

    //            if (actDs.Tables.Count > 0)
    //            {
    //                if (actDs.Tables[0].Rows.Count > 0)
    //                {
    //                    string sYmd = "";
    //                    for (int k = 0; k < dtGrade.Rows.Count; k++)
    //                    {
    //                        if (sYmd.Equals(dtGrade.Rows[k][COL_KEY.KEY_FIELD.ToString()].ToString()) && dtGrade.Columns.Contains(sKey))
    //                        {
    //                            dtGrade.Rows[k][sKey] = dVal;
    //                        }
    //                    }



    //                    dTarget = decimal.Parse(actDs.Tables[0].Rows[0][sColT].ToString());
    //                    dResult = decimal.Parse(actDs.Tables[0].Rows[0][sColR].ToString());
    //                    dAVRate = double.Parse(actDs.Tables[0].Rows[0][sColA].ToString());
    //                }
    //            }
    //        }
    //    }

    //    return dtGrade;
    //}


    #endregion

    #region [지표현황 - 게이지 설정]
    public void SetGuageLayout(GaugeContainer iGauge, GAUGE_COLOR_TYPE iColorType)
    {
        iGauge.Height     = Unit.Pixel(130);
        iGauge.Width      = Unit.Pixel(240);
        iGauge.AutoLayout = false;

        iGauge.BackFrame.BorderColor  = Color.FromArgb(212, 208, 200);
        iGauge.BackFrame.BorderWidth  = 0;
        iGauge.BackFrame.FrameWidth   = 0f;
        iGauge.BackFrame.FrameStyle   = BackFrameStyle.None;
        iGauge.BackFrame.FrameShape   = BackFrameShape.AutoShape;
        iGauge.BackFrame.ShadowOffset = 0f;
        iGauge.BackFrame.BorderStyle  = GaugeDashStyle.NotSet;

        iGauge.CircularGauges.Clear();
        iGauge.CircularGauges.Add("Default");
        CircularGauge cclg = iGauge.CircularGauges[0];

        cclg.Size.Width                     = 100f;
        cclg.Size.Height                    = 96f;
        cclg.PivotPoint.X                   = 50f;
        cclg.PivotPoint.Y                   = 87f;
        cclg.BackFrame.BackColor            = arrColor[(int)iColorType, 0];
        cclg.BackFrame.BackGradientEndColor = arrColor[(int)iColorType, 1];
        cclg.BackFrame.BackGradientType     = Dundas.Gauges.WebControl.GradientType.TopBottom;
        cclg.BackFrame.BorderColor          = Color.DarkGray;
        cclg.BackFrame.BorderWidth          = 2;
        cclg.BackFrame.FrameGradientType    = Dundas.Gauges.WebControl.GradientType.None;
        cclg.BackFrame.FrameStyle           = BackFrameStyle.Edged;
        cclg.BackFrame.FrameShape           = BackFrameShape.AutoShape;
        cclg.BackFrame.FrameWidth           = 0f;
        cclg.Location.X                     = 0f;
        cclg.Location.Y                     = 0f;

        cclg.Ranges.Clear();
        //cclg.Ranges.Add("Alert");
        //CircularRange cclr = cclg.Ranges[0];
        //cclr.StartValue = 0;
        //cclr.EndValue   = 50;
        //cclr.StartWidth = 200f;
        //cclr.EndWidth   = 200f;

        iGauge.Labels.Clear();
        iGauge.Labels.Add("Default");
        GaugeLabel gglt = iGauge.Labels[0];

        gglt.BackColor        = Color.Transparent;
        gglt.BackGradientType = Dundas.Gauges.WebControl.GradientType.None;
        //gglt.Parent = cclg.Name;
        gglt.Text          = "단위";
        gglt.TextAlignment = ContentAlignment.MiddleCenter;
        gglt.Size.Height   = 11f;
        gglt.Size.Width    = 30f;
        gglt.Location.X    = 36f;
        gglt.Location.Y    = 46f;


        cclg.Scales.Clear();
        cclg.Scales.Add("Default");
        CircularScale ccls = cclg.Scales[0];

        ccls.BorderColor  = Color.Gray;
        ccls.FillColor    = Color.Black;
        ccls.Radius       = 58f;
        ccls.ShadowOffset = 0f;
        ccls.StartAngle   = 90f;
        ccls.SweepAngle   = 180f;
        ccls.Width        = 1f;

        ccls.LabelStyle.DistanceFromScale = 5f;
        ccls.LabelStyle.Placement         = Placement.Outside;
        ccls.LabelStyle.TextColor         = Color.Black;

        ccls.MajorTickMark.BorderColor       = Color.Black;
        ccls.MajorTickMark.BorderWidth       = 1;
        ccls.MajorTickMark.DistanceFromScale = 1f;
        ccls.MajorTickMark.FillColor         = Color.Black;
        ccls.MajorTickMark.Length            = 10f;
        ccls.MajorTickMark.Placement         = Placement.Outside;
        ccls.MajorTickMark.Shape             = Dundas.Gauges.WebControl.MarkerStyle.Wedge;
        ccls.MajorTickMark.Width             = 2f;

        ccls.MinorTickMark.BorderColor       = ccls.MajorTickMark.BorderColor;
        ccls.MinorTickMark.BorderWidth       = 1;
        ccls.MinorTickMark.DistanceFromScale = 1f;
        ccls.MinorTickMark.FillColor         = ccls.MajorTickMark.FillColor;
        ccls.MinorTickMark.Length            = 7f;
        ccls.MinorTickMark.Placement         = Placement.Outside;
        ccls.MinorTickMark.Shape             = Dundas.Gauges.WebControl.MarkerStyle.Wedge;
        ccls.MinorTickMark.Width             = 2f;
        ccls.MinorTickMark.EnableGradient    = false;

        cclg.Pointers.Clear();
        CircularPointer cclp = cclg.Pointers[0];

        cclp.BorderWidth          = 0;
        cclp.CapFillColor         = Color.Silver;
        cclp.FillGradientEndColor = Color.MediumTurquoise;
        cclp.CapReflection        = true;
        cclp.CapWidth             = 20f;
        cclp.DistanceFromScale    = 1f;
        cclp.FillColor            = Color.Red;
        cclp.FillGradientEndColor = Color.Pink;
        cclp.FillGradientType     = Dundas.Gauges.WebControl.GradientType.LeftRight;
        cclp.NeedleStyle          = NeedleStyle.NeedleStyle4;
        cclp.Placement            = Placement.Outside;
        cclp.Width = 13f;

        cclp.SnappingEnabled  = true;
        cclp.SnappingInterval = 1;


        cclp.Value   = 50;
        ccls.Maximum = 100;
        ccls.Minimum = 0;
    }
Exemple #24
0
        public static void ModifySeries(Chart tChart1, Color drawPenColor1, PageOrientation orientation)
#endif
        {
            if (tChart1[0] is Steema.TeeChart.Styles.Circular)
            {
                (tChart1[0] as Steema.TeeChart.Styles.Circular).Circled = true;
            }

            if (tChart1.Series[0] is Clock)
            {
                Clock clock = ((Clock)(tChart1.Series[0]));

#if PORTABLE
                tChart1.Touch.Options = TouchOptions.None;
#else
                tChart1.Aspect.GestureOptions = Drawing.Aspect.Gestures.None;
#endif
                tChart1.Aspect.RenderSeriesAsImage = false;

                clock.GetVertAxis.Grid.Visible = false;
#if PORTABLE
                clock.CircleLabelsFont.Color = Color.Black;
#else
                clock.CircleLabelsFont.Color = Colors.White;
#endif
            }

            if (tChart1.Series[0] is Area)
            {
                if (tChart1.Series[0] is HorizArea)
                {
                    tChart1.Header.Text       = "HorizArea";
                    tChart1.SubHeader.Text    = "Pinch and drag to Vertical Scroll and Zoom";
                    tChart1.SubHeader.Visible = true;
                    // Gesture options to vertical
                    tChart1.Zoom.Direction     = ZoomDirections.Vertical;
                    tChart1.Panning.Allow      = ScrollModes.Vertical;
                    tChart1.Legend.Visible     = true;
                    tChart1.Legend.Alignment   = LegendAlignments.Bottom;
                    tChart1.Legend.Pen.Visible = false;

                    tChart1.Series.Add(new Styles.HorizArea());
                    tChart1.Series.Add(new Styles.HorizArea());
                    tChart1.Series.Add(new Styles.HorizArea());
                    tChart1.Axes.Bottom.Grid.Visible = false;

                    foreach (Series s in tChart1.Series)
                    {
                        ((Styles.HorizArea)s).Transparency           = 35;
                        ((Styles.HorizArea)s).AreaLines.Transparency = 35;
                        ((Styles.HorizArea)s).LinePen.Visible        = false;
                        ((Styles.HorizArea)s).AreaLines.Visible      = false;
                        ((Styles.HorizArea)s).FillSampleValues(50);
                    }
                }
                else
                {
                    tChart1.Header.Text       = "Area";
                    tChart1.SubHeader.Text    = "Pinch and drag to Vertical Scroll and Zoom";
                    tChart1.SubHeader.Visible = true;

                    // Gesture options to horizontal
                    tChart1.Zoom.Direction     = ZoomDirections.Horizontal;
                    tChart1.Panning.Allow      = ScrollModes.Horizontal;
                    tChart1.Legend.Visible     = true;
                    tChart1.Legend.Alignment   = LegendAlignments.Bottom;
                    tChart1.Legend.Pen.Visible = false;

                    tChart1.Series.Add(new Styles.Area());
                    tChart1.Series.Add(new Styles.Area());
                    tChart1.Series.Add(new Styles.Area());

                    foreach (Series s in tChart1.Series)
                    {
                        ((Styles.Area)s).Transparency           = 35;
                        ((Styles.Area)s).AreaLines.Transparency = 35;
                        ((Styles.Area)s).LinePen.Visible        = false;
                        ((Styles.Area)s).AreaLines.Visible      = false;
                        ((Styles.Area)s).FillSampleValues(50);
                        ((Styles.Area)s).Stacked = CustomStack.Stack;
                    }
                }
            }

            if ((tChart1.Series[0] is CustomBar) && !(tChart1.Series[0] is Bar3D))
            {
                CustomBar bar = ((CustomBar)(tChart1.Series[0]));
                bar.Brush.Transparency = 25;
                bar.MarksOnBar         = true;

#if !PORTABLE
                if ((App.CurrentTheme == TeeChartForWindowsPhone.App.Theme.Dark))
                {
                    bar.Marks.Font.Color = Colors.Black;
                }
#endif
                bar.Pen.Visible = false;
                if (tChart1.Series[0] is HorizBar)
                {
                    bar.Marks.Font.Size = 18;
                }
                else
                {
                    bar.Marks.Font.Size = 16;
                }
                bar.ColorEach = true;
                Random r = new Random();
                bar.Clear();
                for (int i = 0; i < 5; i++)
                {
                    bar.Add(r.Next(999));
                }
            }

#if !PORTABLE
            if (tChart1.Series[0] is Bar3D)
            {
                CustomBar bar = ((CustomBar)(tChart1.Series[0]));
                if (!(App.CurrentTheme == TeeChartForWindowsPhone.App.Theme.Dark))
                {
                    bar.Brush.Transparency = 25;
                    bar.Marks.Arrow.Color  = Colors.Black;
                    bar.Marks.Font.Color   = Colors.Black;
                }
            }
#endif

            if (tChart1.Series[0] is Bubble)
            {
                Bubble bubble = ((Bubble)(tChart1.Series[0]));
                bubble.Pointer.Gradient.Visible         = true;
                bubble.Pointer.Brush.Gradient.Direction = GradientDirection.Radial;
            }
            if (tChart1.Series[0] is BubbleCloud)
            {
                tChart1.Aspect.View3D = false;
                BubbleCloud BubbleCloud = ((BubbleCloud)(tChart1.Series[0]));
                BubbleCloud.Pen.Visible   = false;
                BubbleCloud.Marks.Visible = true;
            }

            if (tChart1.Series[0] is Styles.Line)
            {
                tChart1.Header.Text += " - Pinch or Drag for Zoom or Scroll";
                if (tChart1.Series[0] is Styles.HorizLine)
                {
                    tChart1.Series.Add(new Styles.HorizLine());
                }
                else
                {
                    tChart1.Series.Add(new Styles.Line());
                    tChart1.Series.Add(new Styles.Line());
                    tChart1.Series.Add(new Styles.Line());
                }

                foreach (Series s in tChart1.Series)
                {
                    if (s is Styles.Line)
                    {
                        ((Styles.Line)s).LinePen.Width = 4;
                    }
                    ((Styles.Line)s).Pointer.Visible     = true;
                    ((Styles.Line)s).Pointer.Pen.Visible = false;
                    s.FillSampleValues();
                }
            }

            if (tChart1.Series[0] is Styles.Bezier)
            {
                Bezier bezier = ((Bezier)(tChart1.Series[0]));
                bezier.LinePen.Width = 3;
            }

            if (tChart1.Series[0] is Styles.Candle)
            {
                Candle candle = ((Candle)(tChart1.Series[0]));
                candle.LinePen.Width      = 3;
                candle.Pen.Color          = Color.Gray;
                candle.LinePen.Color      = Color.Gray;
                candle.HighLowPen.Visible = true;
                candle.HighLowPen.Color   = Color.Green;
#if PORTABLE
                candle.DownCloseColor = Color.Fuschia;
#else
                candle.DownCloseColor = Colors.Orange;
#endif
            }

            if (tChart1.Series[0] is Styles.CircularGauge)
            {
                CircularGauge cGauge = ((CircularGauge)(tChart1.Series[0]));
                if (!(tChart1.Series[0] is Styles.KnobGauge))
#if PORTABLE
                { cGauge.Axis.Labels.Font.Color = Color.Silver; }
#else
                { cGauge.Axis.Labels.Font.Color = Colors.White; }
#endif
                else
                {
#if PORTABLE
                    tChart1.Touch.Options = TouchOptions.Drag;
#else
                    tChart1.Aspect.GestureOptions = Drawing.Aspect.Gestures.DragOnly;
#endif
                    tChart1.Aspect.RenderSeriesAsImage           = false;
                    ((KnobGauge)tChart1.Series[0]).ValueChanged += new GaugesChangeHandler(KnobGauge_ValueChanged);
                }
            }
Exemple #25
0
    public void SetGuageLayout2(GaugeContainer iGauge, GAUGE_COLOR_TYPE iColorType, double iRate)
    {
        Font fntDefault = new Font("", 12f, FontStyle.Regular, GraphicsUnit.Pixel);

        // Gauge 기본설정
        iGauge.Height     = Unit.Pixel(130);
        iGauge.Width      = Unit.Pixel(200);
        iGauge.AutoLayout = true;

        iGauge.BackFrame.BorderColor  = Color.FromArgb(212, 208, 200);
        iGauge.BackFrame.BorderWidth  = 0;
        iGauge.BackFrame.FrameWidth   = 0f;
        iGauge.BackFrame.FrameStyle   = BackFrameStyle.None;
        iGauge.BackFrame.FrameShape   = BackFrameShape.AutoShape;
        iGauge.BackFrame.ShadowOffset = 0f;
        iGauge.BackFrame.BorderStyle  = GaugeDashStyle.NotSet;

        //iGauge.MapAreas.Clear();
        //iGauge.StateIndicators.Clear();

        // 원형게이지 설정
        iGauge.CircularGauges.Clear();
        iGauge.CircularGauges.Add("Default");
        CircularGauge cclg = iGauge.CircularGauges[0];

        cclg.Size.Width   = 100f;
        cclg.Size.Height  = 96f;
        cclg.PivotPoint.X = 50f;
        cclg.PivotPoint.Y = 87f;

        cclg.BackFrame.BackGradientType  = Dundas.Gauges.WebControl.GradientType.None;
        cclg.BackFrame.BorderColor       = Color.Transparent;
        cclg.BackFrame.BorderWidth       = 0;
        cclg.BackFrame.FrameGradientType = Dundas.Gauges.WebControl.GradientType.None;
        cclg.BackFrame.FrameStyle        = BackFrameStyle.None;
        cclg.BackFrame.FrameShape        = BackFrameShape.AutoShape;
        cclg.BackFrame.FrameWidth        = 0f;
        cclg.Location.X = 0f;
        cclg.Location.Y = 0f;

        cclg.Knobs.Clear();
        cclg.Ranges.Clear();

        // 게이지 제목 설정
        iGauge.Labels.Clear();
        iGauge.Labels.Add("Default");


        GaugeLabel gglt = iGauge.Labels[0];

        gglt.BackColor        = Color.Transparent;
        gglt.BackGradientType = Dundas.Gauges.WebControl.GradientType.None;
        //gglt.Parent = cclg.Name;
        gglt.Text          = "달성율(%)";
        gglt.TextAlignment = ContentAlignment.MiddleCenter;
        gglt.Size.Height   = 11f;
        gglt.Size.Width    = 30f;
        gglt.Location.X    = 36f;
        gglt.Location.Y    = 46f;
        gglt.Font          = fntDefault;

        // 게이지 눈금 설정
        cclg.Scales.Clear();
        cclg.Scales.Add("Default");
        CircularScale ccls = cclg.Scales[0];

        ccls.BorderColor      = Color.Gray;
        ccls.FillColor        = ColorTranslator.FromHtml("#5A78AF"); // #ADC9DC
        ccls.Radius           = 73f;
        ccls.ShadowOffset     = 0f;
        ccls.StartAngle       = 80f;
        ccls.SweepAngle       = 200f;
        ccls.Width            = 25f;
        ccls.FillGradientType = Dundas.Gauges.WebControl.GradientType.None;
        ccls.FillHatchStyle   = GaugeHatchStyle.None;

        ccls.LabelStyle.DistanceFromScale = 5f;
        ccls.LabelStyle.Placement         = Placement.Inside;
        ccls.LabelStyle.TextColor         = Color.Black;
        ccls.LabelStyle.Font = fntDefault;

        ccls.MajorTickMark.BorderColor       = ColorTranslator.FromHtml("#E0E8F3");
        ccls.MajorTickMark.BorderWidth       = 0;
        ccls.MajorTickMark.DistanceFromScale = 1f;
        ccls.MajorTickMark.FillColor         = ColorTranslator.FromHtml("#E0E8F3");
        ccls.MajorTickMark.Length            = ccls.Width;
        ccls.MajorTickMark.Placement         = Placement.Cross;
        ccls.MajorTickMark.Shape             = Dundas.Gauges.WebControl.MarkerStyle.None;
        ccls.MajorTickMark.Width             = 5f;
        ccls.MajorTickMark.EnableGradient    = false;

        ccls.MinorTickMark.Visible           = false;
        ccls.MinorTickMark.BorderColor       = ccls.MajorTickMark.BorderColor;
        ccls.MinorTickMark.BorderWidth       = 1;
        ccls.MinorTickMark.DistanceFromScale = 1f;
        ccls.MinorTickMark.FillColor         = ccls.MajorTickMark.FillColor;
        ccls.MinorTickMark.Length            = 7f;
        ccls.MinorTickMark.Placement         = Placement.Outside;
        ccls.MinorTickMark.Shape             = Dundas.Gauges.WebControl.MarkerStyle.Wedge;
        ccls.MinorTickMark.Width             = 2f;
        ccls.MinorTickMark.EnableGradient    = false;

        // 게이지 바늘 설정
        cclg.Pointers.Clear();
        cclg.Pointers.Add("Default");
        CircularPointer cclp = cclg.Pointers[0];

        cclp.BorderWidth          = 0;
        cclp.FillGradientEndColor = Color.MediumTurquoise;
        cclp.DistanceFromScale    = 1f;
        cclp.FillColor            = Color.Red;
        cclp.FillGradientEndColor = Color.Pink;
        cclp.FillGradientType     = Dundas.Gauges.WebControl.GradientType.LeftRight;
        cclp.NeedleStyle          = NeedleStyle.NeedleStyle4;
        cclp.Placement            = Placement.Cross;
        cclp.Width                   = 2f;
        cclp.ShadowOffset            = 3f;
        cclp.CapFillColor            = ColorTranslator.FromHtml("#DFE8ED");
        cclp.CapFillGradientEndColor = ColorTranslator.FromHtml("#508EBF");
        cclp.CapFillGradientType     = Dundas.Gauges.WebControl.GradientType.DiagonalLeft;
        cclp.CapReflection           = true;
        cclp.CapWidth                = 50f;

        double dMax = iRate;

        if (100 < iRate)
        {
            dMax = (iRate - (iRate % 20)) + 20;
            //dMax = Math.Round(iRate,0);
        }
        else
        {
            dMax = 100;
        }

        cclp.Value    = iRate;
        ccls.Maximum  = dMax;
        ccls.Minimum  = 0;
        ccls.Interval = Math.Round(dMax / 10);

        gglt.Text = Math.Round(iRate, 0).ToString() + "%";
    }
        private void InitializeChart()
        {
            Charts = new List <TChart>();
            Charts.Add(tChart1);
            Charts.Add(tChart2);
            Charts.Add(tChart3);
            Charts.Add(tChart4);
            Charts.Add(tChart5);
            Charts.Add(tChart6);
            Charts.Add(tChart7);

            foreach (var item in Charts)
            {
                item.Aspect.View3D                = false;
                item.Header.Font.Color            = Utils.HexToColor("FFFFFFFF");
                item.Header.Font.Size             = 18;
                item.Header.Alignment             = TextAlignment.Left;
                item.Panel.Gradient.Visible       = false;
                item.Walls.Visible                = false;
                item.Legend.Visible               = false;
                item.Aspect.GestureOptions        = Steema.TeeChart.Store.Drawing.Aspect.Gestures.None;
                item.Axes.Bottom.Visible          = false;
                item.Axes.Left.AxisPen.Visible    = false;
                item.Axes.Left.Labels.Font.Color  = Utils.HexToColor("FFFFFFFF");
                item.Axes.Left.Grid.Color         = Utils.HexToColor("FFFFFFFF");
                item.Axes.Left.Ticks.Visible      = false;
                item.Axes.Left.MinorTicks.Visible = false;
            }

            tChart1.Panel.Color = Utils.HexToColor("FF66CDAA");
            tChart2.Panel.Color = Utils.HexToColor("FF0066CC");
            tChart3.Panel.Color = Utils.HexToColor("FFDC143C");
            tChart4.Panel.Color = Utils.HexToColor("FFFFA500");
            tChart5.Panel.Color = Utils.HexToColor("FFFF69B4");
            tChart6.Panel.Color = Utils.HexToColor("FFBA55D3");
            tChart7.Panel.Color = Utils.HexToColor("FF66CDAA");

            Bar bar = new Bar(tChart1.Chart);

            bar.Gradient.Visible     = true;
            bar.Gradient.StartColor  = Utils.HexToColor("FFFFFFFF");
            bar.Gradient.EndColor    = Colors.Transparent;
            bar.Pen.Visible          = false;
            bar.RoundSize            = 8;
            bar.BarRound             = BarRounding.AtValue;
            bar.BarStyle             = BarStyles.RoundRectangle;
            bar.Marks.Arrow.Visible  = false;
            bar.Marks.Brush.Color    = bar.Gradient.StartColor;
            bar.Marks.Pen.Visible    = false;
            bar.Marks.Font.Color     = tChart1.Panel.Color;
            bar.Marks.Shadow.Visible = false;
            bar.Marks.ShapeStyle     = Steema.TeeChart.Store.Drawing.TextShapeStyle.RoundRectangle;
            bar.FillSampleValues();
            Line line = new Line(tChart1.Chart);

            line.Color = Utils.HexToColor("FFFFFFFF");
            line.FillSampleValues();
            line.Smoothed = true;

            tChart1.Header.Text = "Lines and Bars";

            ActivityGauge world = new ActivityGauge(tChart2.Chart);
            Random        rnd   = new Random();

            tChart2.Panel.Color            = Colors.White;
            tChart2.Panel.Gradient.Visible = false;
            world.BackColor = Colors.White;
            world.Add(rnd.Next(100), Utils.FromArgb(135, 206, 250));
            world.Add(rnd.Next(100), Utils.FromArgb(102, 205, 170));
            world.Add(rnd.Next(100), Utils.FromArgb(220, 20, 60));
            world.Add(rnd.Next(100), Utils.FromArgb(255, 105, 180));
            world.Add(rnd.Next(100), Utils.FromArgb(186, 85, 211));

            tChart2.Header.Text       = "Gauges";
            tChart2.Header.Font.Color = Utils.FromArgb(186, 85, 211);


            CircularGauge gauge = new CircularGauge(tChart4.Chart);

            gauge.Frame.Visible = false;
            gauge.FaceBrush.Gradient.Visible    = false;
            gauge.FaceBrush.Color               = tChart4.Panel.Color;
            gauge.GreenLine.Pen.Visible         = false;
            gauge.GreenLine.Gradient.EndColor   = Utils.HexToColor("FFFDFDFD");
            gauge.GreenLine.Gradient.StartColor = Utils.HexToColor("FFC4C4C4");
            gauge.RedLine.Gradient.StartColor   = Utils.HexToColor("FFC4C4C4");
            gauge.RedLine.Gradient.EndColor     = Utils.HexToColor("FF848484");
            gauge.RedLine.Pen.Visible           = false;
            gauge.Ticks.Gradient.Visible        = false;
            gauge.Ticks.Color                 = Utils.HexToColor("FFFFFFFF");
            gauge.Ticks.Pen.Color             = Utils.HexToColor("FFFFFFFF");
            gauge.MinorTicks.Gradient.Visible = false;
            gauge.MinorTicks.Color            = Utils.HexToColor("FFFFFFFF");
            gauge.MinorTicks.Pen.Color        = Utils.HexToColor("FFFFFFFF");
            gauge.Hand.Gradient.Visible       = false;
            gauge.Hand.Color             = Utils.HexToColor("FFFDFDFD");
            gauge.Hand.Shadow.Visible    = false;
            gauge.Center.Shadow.Visible  = false;
            gauge.Axis.Labels.Font.Size  = 8;
            gauge.Axis.Labels.Font.Color = Utils.HexToColor("FFFFFFFF");
            gauge.Axis.AxisPen.Visible   = true;
            gauge.Axis.AxisPen.Color     = Utils.HexToColor("FFFFFFFF");
            gauge.FillSampleValues();
            tChart4.Header.Text = "Gauges";

            Bubble bubble = new Bubble(tChart5.Chart);

            bubble.ColorEach = false;
            bubble.Pointer.Gradient.Visible     = true;
            bubble.Pointer.Pen.Visible          = false;
            bubble.Pointer.Gradient.StartColor  = Utils.HexToColor("FFFFFFFF");
            bubble.Pointer.Gradient.EndColor    = Colors.Transparent;
            tChart5.Axes.Left.Labels.Font.Color = Colors.Transparent;
            bubble.Add(1, 1, 1);
            bubble.Add(2, 2, 10);
            bubble.Add(3, 3, 5);
            bubble.Add(4, 4, 3);
            bubble.Add(5, 5, 7);
            tChart5.Header.Text = "Bubbles and Gantt";

            Area area = new Area(tChart6.Chart);

            area.LinePen.Color       = Utils.HexToColor("FFFFFFFF");
            area.Gradient.Visible    = true;
            area.Gradient.StartColor = Utils.HexToColor("FFFFFFFF");
            area.Gradient.EndColor   = Colors.Transparent;
            area.Smoothed            = true;
            area.FillSampleValues();
            Area area1 = new Area(tChart6.Chart);

            area1.LinePen.Color       = Utils.HexToColor("FFFFFFFF");
            area1.Gradient.Visible    = true;
            area1.Gradient.StartColor = Utils.HexToColor("FFFFFFFF");
            area1.Gradient.EndColor   = Colors.Transparent;
            area1.Smoothed            = true;
            area1.FillSampleValues();
            tChart6.Axes.Left.Visible              = false;
            tChart6.Axes.Bottom.Visible            = true;
            tChart6.Header.Text                    = "Areas and Points";
            tChart6.Axes.Bottom.AxisPen.Visible    = false;
            tChart6.Axes.Bottom.Labels.Font.Color  = Utils.HexToColor("FFFFFFFF");
            tChart6.Axes.Bottom.Grid.Color         = Utils.HexToColor("FFFFFFFF");
            tChart6.Axes.Bottom.Ticks.Visible      = false;
            tChart6.Axes.Bottom.MinorTicks.Visible = false;
            tChart6.Axes.Bottom.Increment          = 10;
            tChart6.Axes.Bottom.Labels.Font.Size   = 10;

            Pie pie = new Pie(tChart3.Chart);

            pie.ColorEach = false;
            pie.Add(2, "Tables", Utils.HexToColor("FFFFFFFF"));
            pie.Add(1, "Chairs", Utils.HexToColor("FFF2F2F2"));
            pie.Add(1, "Sofas", Utils.HexToColor("FFDFDFDF"));
            pie.Add(1, "Cupboards", Utils.HexToColor("FFD7D7D7"));
            pie.AutoPenColor        = false;
            pie.Pen.Color           = tChart3.Panel.Color;
            pie.Pen.Width           = 3;
            pie.Circled             = true;
            pie.Marks.Brush.Visible = false;
            pie.Marks.Pen.Visible   = false;
            pie.Marks.Font.Color    = tChart3.Panel.Color;
            pie.Marks.Font.Size     = 6;
            pie.Marks.ArrowLength   = -20;
            pie.Marks.Arrow.Visible = false;
            pie.AutoCircleResize    = false;
            pie.BeforeDrawValues   += Pie_BeforeDrawValues;

            Donut donut = new Donut(tChart3.Chart);

            donut.ColorEach = false;
            donut.Circled   = true;
            donut.Add(2, "Tables", Utils.HexToColor("FFFFFFFF"));
            donut.Add(1, "Chairs", Utils.HexToColor("FFF2F2F2"));
            donut.Add(1, "Sofas", Utils.HexToColor("FFDFDFDF"));
            donut.Add(1, "Cupboards", Utils.HexToColor("FFD7D7D7"));
            donut.MarksPie.LegSize    = 10;
            donut.Marks.Brush.Visible = false;
            donut.Marks.Pen.Visible   = false;
            donut.Marks.Font.Color    = Utils.HexToColor("FFFFFFFF");
            donut.Marks.Font.Size     = 6;
            donut.Marks.Arrow.Color   = Utils.HexToColor("FFFFFFFF");
            donut.AutoPenColor        = false;
            donut.Pen.Color           = tChart3.Panel.Color;
            donut.Pen.Width           = 3;
            donut.AutoCircleResize    = false;
            donut.BeforeDrawValues   += Donut_BeforeDrawValues;
            tChart3.Header.Text       = "Pies and Donuts";


            Calendar calendar = new Calendar(tChart7.Chart);

            calendar.NextMonthButton.Visible     = false;
            calendar.PreviousMonthButton.Visible = false;
            tChart7.Header.Text = "Calendars";
        }
        public BasePageView()
        {
            this.InitializeComponent();

            // Set the actual size of the page based on the resolution of the phyical device we are on.
            this.MainGrid.Height = Globals.ScreenSize.Height;
            this.MainGrid.Width  = Globals.ScreenSize.Width;

            this.Loaded         += BasePageView_Loaded;
            this.PointerPressed += BasePageView_PointerPressed;
            this.KeyDown        += MainCanvas_KeyDown;
            this.EditRibbon.ViewModel.SelectedGaugeItemList = _gaugeItemSelectedList;

            Messenger.Default.Register <List <IGaugeItem> >(this, "AddGaugeItemList", (gaugeItemList) =>
            {
                if (null == gaugeItemList)
                {
                    return;
                }
                if (gaugeItemList[0].PageId != this.ViewModel.GaugePageItem.PageId)
                {
                    return;
                }

                foreach (IGaugeItem gaugeItem in gaugeItemList)
                {
                    BaseGauge gauge = null;
                    switch (gaugeItem.GaugeType)
                    {
                    case GaugeTypeEnum.CircularGauge:
                        gauge = new CircularGauge();
                        break;

                    case GaugeTypeEnum.CompassRoseGauge:
                        gauge = new CompassRoseGauge();
                        break;

                    case GaugeTypeEnum.DonutGauge:
                        gauge = new DonutGauge();
                        break;

                    case GaugeTypeEnum.HorizontalBarGauge:
                        gauge = new HorizontalBarGauge();
                        break;

                    case GaugeTypeEnum.LeftArcGauge:
                        gauge = new LeftArcGauge();
                        break;

                    case GaugeTypeEnum.LeftTankGauge:
                        gauge = new TankGaugeLeft();
                        break;

                    case GaugeTypeEnum.PieChartGauge:
                        gauge = new PieChartGauge();
                        ((PieChartGauge)gauge).SensorCollection.Add(App.SensorCollection[0]);
                        ((PieChartGauge)gauge).SensorCollection.Add(App.SensorCollection[1]);
                        ((PieChartGauge)gauge).SensorCollection.Add(App.SensorCollection[2]);
                        break;

                    case GaugeTypeEnum.RightArcGauge: break;

                    case GaugeTypeEnum.RightTankGauge:
                        gauge = new TankGaugeRight();
                        break;

                    case GaugeTypeEnum.TextControl:
                        gauge = new TextControl();
                        break;

                    case GaugeTypeEnum.TextGauge:
                        gauge = new TextGauge();
                        break;

                    case GaugeTypeEnum.VerticalBarGauge:
                        gauge = new VerticalBarGauge();
                        break;
                    }

                    gauge.GaugeItem  = gaugeItem;
                    gauge.SensorItem = App.SensorCollection.FindBySensorId(gaugeItem.SensorId);

                    // Calculate the row/col position of this gauge
                    this.CanvasGrid.AddChildBaseGauge(gauge as BaseGauge, _nextRow, _nextCol);

                    _nextCol++;
                    if (_nextCol >= this.ViewModel.Cols)
                    {
                        _nextRow++;
                        _nextCol = 0;
                    }

                    // Persist the calculated (X,Y) location of the gauge
                    Task.Run(async() => { await gaugeItem.BeginCommit(); }).Wait();
                }
            });

            // Register to receive lists of gauges to display on the screen. Each item in this list
            // already has an (X,Y) location specified,
            Messenger.Default.Register <List <IGaugeItem> >(this, "BuildGaugeItemList", (gaugeItemList) =>
            {
                if (null == gaugeItemList)
                {
                    return;
                }
                if (gaugeItemList[0].PageId != this.ViewModel.GaugePageItem.PageId)
                {
                    return;
                }

                this.CanvasGrid.Children.Clear();
                BaseGauge gauge = null;

                foreach (IGaugeItem item in gaugeItemList)
                {
                    switch (item.GaugeType)
                    {
                    case GaugeTypeEnum.CircularGauge:
                        gauge = BuildCircularGauge(item);
                        break;

                    case GaugeTypeEnum.DonutGauge:
                        gauge = this.BuildDonutGauge(item);
                        break;

                    case GaugeTypeEnum.HorizontalBarGauge:
                        gauge = this.BuildHorizontalBarGauge(item);
                        break;

                    case GaugeTypeEnum.LeftArcGauge:
                        gauge = this.BuildLeftArcGauge(item);
                        break;

                    case GaugeTypeEnum.LeftTankGauge:
                        gauge = this.BuildLeftTankGauge(item);
                        break;

                    case GaugeTypeEnum.PieChartGauge:
                        gauge = this.BuildPieChartGauge(item);
                        break;

                    case GaugeTypeEnum.RightArcGauge: break;

                    case GaugeTypeEnum.RightTankGauge:
                        gauge = this.BuildRightTankGauge(item);
                        break;

                    case GaugeTypeEnum.TextControl:
                        gauge = this.BuildTextControl(item);
                        break;

                    case GaugeTypeEnum.TextGauge:
                        gauge = this.BuildTextGauge(item);
                        break;

                    case GaugeTypeEnum.VerticalBarGauge:
                        gauge = this.BuildVerticalBarGauge(item);
                        break;
                    }
                }
            });
        }