Example #1
0
        void InitializeChart(double level)
        {
            tChart1 = new Steema.TeeChart.TChart(ApplicationContext);

            tChart1.Header.Visible    = true;
            tChart1.Header.Text       = "Battery Level";
            tChart1.Header.Font.Size  = 20;
            tChart1.Header.Font.Color = Color.LightGray;

            tChart1.Panel.Visible = false;

            var circularGauge1 = new Steema.TeeChart.Styles.CircularGauge(tChart1.Chart);

            circularGauge1.Value = level * 100;
            circularGauge1.NumericGauge.Visible     = true;
            circularGauge1.NumericGauge.ValueFormat = "###.0";
            circularGauge1.NumericGauge.ValueMarker.Shape.Font.Size = 25;
            circularGauge1.TotalAngle                     = 240;
            circularGauge1.RedLine.Visible                = false;
            circularGauge1.GreenLineStartValue            = 0;
            circularGauge1.GreenLineEndValue              = 100;
            circularGauge1.GreenLine.Gradient.Direction   = Steema.TeeChart.Drawing.GradientDirection.RightLeft;
            circularGauge1.GreenLine.Gradient.UseMiddle   = true;
            circularGauge1.GreenLine.Gradient.StartColor  = Color.Red;
            circularGauge1.GreenLine.Gradient.MiddleColor = Color.Yellow;
            circularGauge1.GreenLine.Gradient.EndColor    = Color.Green;
            circularGauge1.Axis.Labels.Font.Color         = Color.LightGray;
            circularGauge1.Axis.Labels.Font.Size          = 15;
            circularGauge1.MinorTicks.Visible             = true;
            circularGauge1.MinorTicks.VertSize            = 2;
            circularGauge1.MinorTicks.HorizSize           = 2;
            circularGauge1.Axis.MinorTickCount            = 4;

            SetContentView(tChart1);
        }
        public Page3()
        {
            // NavigationPage.SetHasNavigationBar(this, false);

            dashChart = new Chart();
            dashChart.Aspect.View3D = false;
            Steema.TeeChart.Styles.CircularGauge series = new Steema.TeeChart.Styles.CircularGauge();
            dashChart.Series.Add(series);
            series.FillSampleValues();

            //Gauges chart
            dashChart.Panel.Color            = Color.FromRgb(220, 20, 60);
            dashChart.Panel.Gradient.Visible = false;
            dashChart.Walls.Back.Visible     = false;
            dashChart.Footer.Text            = "Gauges";
            dashChart.Footer.Alignment       = TextAlignment.Center;
            dashChart.Footer.Visible         = true;
            dashChart.Header.Visible         = false;
            dashChart.Footer.Font.Size       = 12;
            dashChart.Footer.Font.Color      = Color.White;
            dashChart.Legend.Visible         = false;

            dashChart.Axes.Left.Visible            = true;
            dashChart.Axes.Left.Labels.Visible     = false;
            dashChart.Axes.Left.Ticks.Visible      = false;
            dashChart.Axes.Left.TicksInner.Visible = false;
            dashChart.Axes.Left.Labels.Font.Color  = Color.White;
            series.Axis.TicksInner.Visible         = false;
            series.Axis.Ticks.Visible  = false;
            series.Axis.Labels.Visible = false;

            series.FaceBrush.Visible           = false;
            series.Frame.Visible               = false;
            series.FaceBrush.Gradient.Visible  = false;
            series.Axis.AxisPen.Color          = Color.White;
            series.Axis.Ticks.Visible          = false;
            series.Axis.TicksInner.Length      = 3;
            series.RedLine.Gradient.StartColor = Color.White;
            series.GreenLine.Gradient.EndColor = Color.White;
            series.Hand.Gradient.EndColor      = Color.White;
            series.Center.Gradient.Visible     = false;
            series.Center.Color = Color.White;
            series.Value        = 50;

            DashView2 = new ChartView
            {
                VerticalOptions   = LayoutOptions.FillAndExpand,
                HorizontalOptions = LayoutOptions.FillAndExpand,
            };
            DashView2.Model = dashChart;

            Content = new StackLayout
            {
                Children =
                {
                    DashView2
                }
            };
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            chart1 = new TChart();
            chart2 = new TChart();
            chart3 = new TChart();
            chart4 = new TChart();

            CoreGraphics.CGRect r1 = this.View.Frame;
            r1.Height    = r1.Height / 4;
            r1.Y         = (r1.Height * 3) - 85;
            chart1.Frame = r1;

            CoreGraphics.CGRect r4 = this.View.Frame;
            r4.Height    = r4.Height / 4;
            r4.Y         = (r4.Height * 2) - 85;
            chart4.Frame = r4;

            CoreGraphics.CGRect r2 = this.View.Frame;
            r2.Height    = r2.Height / 2;
            r2.Width     = r2.Width / 2 + 40;
            r2.Y         = -25;
            r2.X         = -25;
            chart2.Frame = r2;

            CoreGraphics.CGRect r3 = this.View.Frame;
            r3.Height    = r3.Height / 2;
            r3.Width     = r3.Width / 2 + 40;
            r3.X         = r3.Width - 55;
            r3.Y         = -25;
            chart3.Frame = r3;

            chart1.Series.Add(new Steema.TeeChart.Styles.Volume());
            chart1.Series[0].FillSampleValues();
            chart1.Aspect.View3D            = false;
            chart1.Axes.Bottom.Grid.Visible = false;
            chart1.Legend.Visible           = false;
            chart1.Axes.Left.Visible        = false;


            for (int i = 0; i < 3; i++)
            {
                chart4.Series.Add(new Steema.TeeChart.Styles.Line());
                chart4.Series[i].FillSampleValues(20);
                chart4.Series[i].Marks.Visible = false;
                (chart4.Series[i] as Steema.TeeChart.Styles.Line).LinePen.Width = 3;
            }

            chart4.Aspect.View3D         = false;
            chart4.Axes.Bottom.Increment = 3;

            Steema.TeeChart.Styles.CircularGauge gauge1 = new Steema.TeeChart.Styles.CircularGauge();
            Steema.TeeChart.Styles.CircularGauge gauge2 = new Steema.TeeChart.Styles.CircularGauge();

            chart2.Series.Add(gauge1);
            chart3.Series.Add(gauge2);

            chart2.Panel.MarginTop    = 0;
            chart2.Panel.MarginBottom = 0;
            chart2.Panel.MarginLeft   = 0;
            chart2.Panel.MarginRight  = 0;

            chart3.Panel.MarginTop    = 0;
            chart3.Panel.MarginBottom = 0;
            chart3.Panel.MarginLeft   = 0;
            chart3.Panel.MarginRight  = 0;

            this.View.AddSubview(chart1);
            this.View.AddSubview(chart2);
            this.View.AddSubview(chart3);
            this.View.AddSubview(chart4);

            chart3.Axes.Left.Labels.Font.Size = 5;
            chart2.Axes.Left.Labels.Font.Size = 5;

            gauge1.Frame.Width                = 15;
            gauge1.Ticks.VertSize             = 3;
            gauge1.Center.Shadow.Visible      = false;
            gauge1.Axis.AxisPen.Visible       = false;
            gauge1.FaceBrush.Gradient.Visible = false;
            gauge1.FaceBrush.Color            = Color.FromArgb(220, 220, 220);
            gauge1.Hand.Color            = Color.FromArgb(255, 65, 56);
            gauge1.Hand.Gradient.Visible = false;
            gauge1.Hand.Shadow.Visible   = false;
            gauge1.Axis.AxisPen.Visible  = false;
            gauge1.Value          = 75;
            gauge1.Ticks.VertSize = 3;

            gauge2.Frame.Width                = 15;
            gauge2.Ticks.VertSize             = 3;
            gauge2.Axis.AxisPen.Visible       = false;
            gauge2.Center.Shadow.Visible      = false;
            gauge2.FaceBrush.Gradient.Visible = false;
            gauge2.FaceBrush.Color            = Color.FromArgb(220, 220, 220);
            gauge2.Hand.Color            = Color.FromArgb(255, 65, 56);
            gauge2.Hand.Gradient.Visible = false;
            gauge2.Hand.Shadow.Visible   = false;
            gauge2.Axis.AxisPen.Visible  = false;
            gauge2.Value          = 50;
            gauge2.Ticks.VertSize = 3;


            chart1.Header.Visible = false;
            chart2.Header.Visible = false;
            chart3.Header.Visible = false;
            chart4.Header.Visible = false;

            chart1.Panel.Gradient.Visible        = false;
            chart1.Panel.Color                   = Color.Black;
            chart1.Walls.Back.Transparent        = true;
            chart1.Legend.Visible                = false;
            chart1.Axes.Bottom.Labels.Font.Color = Color.FromArgb(220, 220, 220);

            chart4.Panel.Gradient.Visible        = false;
            chart4.Panel.Color                   = Color.Black;
            chart4.Walls.Back.Transparent        = true;
            chart4.Legend.Visible                = false;
            chart4.Axes.Left.Visible             = false;
            chart4.Axes.Bottom.Labels.Font.Color = Color.FromArgb(220, 220, 220);

            chart2.Panel.Gradient.Visible = false;
            chart2.Panel.Color            = Color.Black;

            chart3.Panel.Gradient.Visible = false;
            chart3.Panel.Color            = Color.Black;

            chart2.Panel.MarginTop    = 0;
            chart2.Panel.MarginLeft   = 0;
            chart2.Panel.MarginBottom = 0;
            chart2.Panel.MarginRight  = 0;

            chart3.Panel.MarginTop    = 0;
            chart3.Panel.MarginLeft   = 0;
            chart3.Panel.MarginBottom = 0;
            chart3.Panel.MarginRight  = 0;

            this.View.BackgroundColor = UIColor.Black;

            imageview = new UIImageView(UIImage.FromBundle("logo.png"));

            CoreGraphics.CGRect rimage = new CoreGraphics.CGRect((this.View.Frame.Width / 2) - 69, this.View.Frame.Height - 76, 138, 70);
            imageview.Frame = rimage;

            this.View.AddSubview(imageview);
        }
Example #4
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.checkBox1   = new System.Windows.Forms.CheckBox();
     this.bEdit       = new System.Windows.Forms.Button();
     this.nUPOuter    = new System.Windows.Forms.NumericUpDown();
     this.labelOuter  = new System.Windows.Forms.Label();
     this.nUPMiddle   = new System.Windows.Forms.NumericUpDown();
     this.labelMiddle = new System.Windows.Forms.Label();
     this.nUPInner    = new System.Windows.Forms.NumericUpDown();
     this.labelInner  = new System.Windows.Forms.Label();
     this.nUPWidth    = new System.Windows.Forms.NumericUpDown();
     this.lblWidth    = new System.Windows.Forms.Label();
     this.label1      = new System.Windows.Forms.Label();
     this.cGauge      = new Steema.TeeChart.Styles.CircularGauge();
     this.panel1.SuspendLayout();
     this.chartContainer.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.nUPOuter)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.nUPMiddle)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.nUPInner)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.nUPWidth)).BeginInit();
     this.SuspendLayout();
     //
     // textBox1
     //
     this.textBox1.Name = "textBox1";
     this.textBox1.Size = new System.Drawing.Size(564, 73);
     this.textBox1.Text = "CircularGauge provides a fully configurable and quick drawing circular gauge styl" +
                          "e. New in this version is the option to change the size of the different outer b" +
                          "order concentric frames of the Gauge.";
     //
     // panel1
     //
     this.panel1.Controls.Add(this.label1);
     this.panel1.Controls.Add(this.nUPWidth);
     this.panel1.Controls.Add(this.lblWidth);
     this.panel1.Controls.Add(this.nUPInner);
     this.panel1.Controls.Add(this.labelInner);
     this.panel1.Controls.Add(this.nUPMiddle);
     this.panel1.Controls.Add(this.labelMiddle);
     this.panel1.Controls.Add(this.nUPOuter);
     this.panel1.Controls.Add(this.labelOuter);
     this.panel1.Controls.Add(this.bEdit);
     this.panel1.Controls.Add(this.checkBox1);
     this.panel1.Name = "panel1";
     this.panel1.Size = new System.Drawing.Size(564, 45);
     //
     // tChart1
     //
     this.tChart1.Name = "tChart1";
     this.tChart1.Series.Add(this.cGauge);
     this.tChart1.Size = new System.Drawing.Size(564, 372);
     //
     // chartContainer
     //
     this.chartContainer.Location = new System.Drawing.Point(0, 118);
     this.chartContainer.Name     = "chartContainer";
     this.chartContainer.Size     = new System.Drawing.Size(564, 372);
     //
     // checkBox1
     //
     this.checkBox1.Checked         = true;
     this.checkBox1.CheckState      = System.Windows.Forms.CheckState.Checked;
     this.checkBox1.Location        = new System.Drawing.Point(12, 3);
     this.checkBox1.Name            = "checkBox1";
     this.checkBox1.Size            = new System.Drawing.Size(76, 17);
     this.checkBox1.TabIndex        = 0;
     this.checkBox1.Text            = "Animate";
     this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
     //
     // bEdit
     //
     this.bEdit.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     this.bEdit.Location  = new System.Drawing.Point(12, 19);
     this.bEdit.Name      = "bEdit";
     this.bEdit.TabIndex  = 1;
     this.bEdit.Text      = "Edit...";
     this.bEdit.Click    += new System.EventHandler(this.bEdit_Click);
     //
     // nUPOuter
     //
     this.nUPOuter.Location      = new System.Drawing.Point(314, 9);
     this.nUPOuter.Name          = "nUPOuter";
     this.nUPOuter.Size          = new System.Drawing.Size(49, 21);
     this.nUPOuter.TabIndex      = 29;
     this.nUPOuter.KeyUp        += new System.Windows.Forms.KeyEventHandler(this.nUPInner_KeyUp);
     this.nUPOuter.ValueChanged += new System.EventHandler(this.numericUpDownFramePercent_ValueChanged);
     //
     // labelOuter
     //
     this.labelOuter.AutoSize = true;
     this.labelOuter.Location = new System.Drawing.Point(267, 12);
     this.labelOuter.Name     = "labelOuter";
     this.labelOuter.Size     = new System.Drawing.Size(54, 17);
     this.labelOuter.TabIndex = 28;
     this.labelOuter.Text     = "Outer %:";
     //
     // nUPMiddle
     //
     this.nUPMiddle.Location      = new System.Drawing.Point(416, 9);
     this.nUPMiddle.Name          = "nUPMiddle";
     this.nUPMiddle.Size          = new System.Drawing.Size(49, 21);
     this.nUPMiddle.TabIndex      = 31;
     this.nUPMiddle.KeyUp        += new System.Windows.Forms.KeyEventHandler(this.nUPInner_KeyUp);
     this.nUPMiddle.ValueChanged += new System.EventHandler(this.numericUpDownFramePercent_ValueChanged);
     //
     // labelMiddle
     //
     this.labelMiddle.AutoSize = true;
     this.labelMiddle.Location = new System.Drawing.Point(364, 12);
     this.labelMiddle.Name     = "labelMiddle";
     this.labelMiddle.Size     = new System.Drawing.Size(60, 17);
     this.labelMiddle.TabIndex = 30;
     this.labelMiddle.Text     = "Middle %:";
     //
     // nUPInner
     //
     this.nUPInner.Location      = new System.Drawing.Point(511, 9);
     this.nUPInner.Name          = "nUPInner";
     this.nUPInner.Size          = new System.Drawing.Size(49, 21);
     this.nUPInner.TabIndex      = 33;
     this.nUPInner.KeyUp        += new System.Windows.Forms.KeyEventHandler(this.nUPInner_KeyUp);
     this.nUPInner.ValueChanged += new System.EventHandler(this.numericUpDownFramePercent_ValueChanged);
     //
     // labelInner
     //
     this.labelInner.AutoSize = true;
     this.labelInner.Location = new System.Drawing.Point(466, 12);
     this.labelInner.Name     = "labelInner";
     this.labelInner.Size     = new System.Drawing.Size(54, 17);
     this.labelInner.TabIndex = 32;
     this.labelInner.Text     = "Inner %:";
     //
     // nUPWidth
     //
     this.nUPWidth.Location      = new System.Drawing.Point(214, 9);
     this.nUPWidth.Name          = "nUPWidth";
     this.nUPWidth.Size          = new System.Drawing.Size(39, 21);
     this.nUPWidth.TabIndex      = 35;
     this.nUPWidth.KeyUp        += new System.Windows.Forms.KeyEventHandler(this.nUPWidth_KeyUp);
     this.nUPWidth.ValueChanged += new System.EventHandler(this.nUPWidth_ValueChanged);
     //
     // lblWidth
     //
     this.lblWidth.AutoSize = true;
     this.lblWidth.Location = new System.Drawing.Point(163, 12);
     this.lblWidth.Name     = "lblWidth";
     this.lblWidth.Size     = new System.Drawing.Size(54, 17);
     this.lblWidth.TabIndex = 34;
     this.lblWidth.Text     = "Width %:";
     //
     // label1
     //
     this.label1.AutoSize = true;
     this.label1.Location = new System.Drawing.Point(121, 12);
     this.label1.Name     = "label1";
     this.label1.Size     = new System.Drawing.Size(35, 17);
     this.label1.TabIndex = 36;
     this.label1.Text     = "Frame";
     //
     // cGauge
     //
     this.cGauge.Circled             = true;
     this.cGauge.Color               = System.Drawing.Color.FromArgb(((System.Byte)(68)), ((System.Byte)(102)), ((System.Byte)(163)));
     this.cGauge.ColorEach           = false;
     this.cGauge.CustomBounds        = new System.Drawing.Rectangle(0, 0, 0, 0);
     this.cGauge.GreenLineEndValue   = 70;
     this.cGauge.GreenLineStartValue = 0;
     this.cGauge.Maximum             = 100;
     this.cGauge.Minimum             = 0;
     this.cGauge.RedLineEndValue     = 100;
     this.cGauge.RedLineStartValue   = 80;
     this.cGauge.ShowInLegend        = false;
     this.cGauge.Title               = "circularGauge1";
     this.cGauge.TotalAngle          = 300;
     this.cGauge.Value               = 96.613414630579484;
     //
     // cGauge.XValues
     //
     this.cGauge.XValues.DataMember = "Angle";
     this.cGauge.XValues.Order      = Steema.TeeChart.Styles.ValueListOrder.Ascending;
     //
     // cGauge.YValues
     //
     this.cGauge.YValues.DataMember = "Y";
     //
     // CircularGauge_Series
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
     this.ClientSize        = new System.Drawing.Size(564, 490);
     this.Name = "CircularGauge_Series";
     this.Text = "CircularGauge_Series";
     this.panel1.ResumeLayout(false);
     this.chartContainer.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.nUPOuter)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.nUPMiddle)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.nUPInner)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.nUPWidth)).EndInit();
     this.ResumeLayout(false);
 }