private void chartGaugesInv(DataTable argDt, bool argEva , DevExpress.XtraGauges.Win.Gauges.Circular.ArcScaleComponent argArcScale , DevExpress.XtraGauges.Win.Gauges.Circular.ArcScaleRangeBarComponent arcRangeBar , DevExpress.XtraGauges.Win.Base.LabelComponent argLabelDay , DevExpress.XtraGauges.Win.Base.LabelComponent argLabePlan , DevExpress.XtraGauges.Win.Base.LabelComponent argLabeTon) { try { // DataTable dt = SEL_FG_DAYS_INV("014", Mline); argArcScale.EnableAnimation = false; argArcScale.EasingMode = DevExpress.XtraGauges.Core.Model.EasingMode.EaseIn; argArcScale.EasingFunction = new BackEase(); argArcScale.MinValue = 0; // argArcScale.MaxValue = Convert.ToInt32(argDt.Rows[0]["VALUE_MAX"]); //arcScaleGauges.Ranges[0].EndValue = arcScaleGauges.Ranges[1].StartValue = Convert.ToSingle(10); //arcScaleGauges.Ranges[1].EndValue = arcScaleGauges.Ranges[2].StartValue = Convert.ToSingle(15); //arcScaleGauges.Ranges[2].EndValue = Convert.ToSingle(20); argArcScale.Value = 0; argLabelDay.Text = ""; argLabePlan.Text = ""; argLabeTon.Text = ""; argArcScale.MinValue = 0; argArcScale.MaxValue = Convert.ToSingle(argDt.Rows[0]["VALUE_MAX"]); argArcScale.EnableAnimation = true; argArcScale.EasingMode = DevExpress.XtraGauges.Core.Model.EasingMode.EaseInOut; argArcScale.EasingFunction = new BackEase(); double num; double.TryParse(argDt.Rows[0]["VALUE_DATA"].ToString(), out num); argArcScale.Value = (float)num; argLabelDay.Text = num.ToString(); argLabePlan.Text = argDt.Rows[0]["PLAN_DATA"].ToString(); argLabeTon.Text = argDt.Rows[0]["INV"].ToString(); if (num > 0.5) { arcRangeBar.Shader = new DevExpress.XtraGauges.Core.Drawing.StyleShader("Colors[Style1:Red;Style2:Red]"); } //else if (num >= 2) // arcRangeBar.Shader = new DevExpress.XtraGauges.Core.Drawing.StyleShader("Colors[Style1:Yellow;Style2:Yellow]"); else { arcRangeBar.Shader = new DevExpress.XtraGauges.Core.Drawing.StyleShader("Colors[Style1:Green;Style2:Green]"); } // lblTar.Text = argDt.Rows[0]["TARGET"].ToString(); // lblProd.Text = argDt.Rows[0]["PROD_QTY"].ToString(); } catch { } // } }
private void chartGaugesProd(DataTable argDt, bool argEva, DevExpress.XtraGauges.Win.Gauges.Circular.ArcScaleComponent argArcScale , DevExpress.XtraGauges.Win.Base.LabelComponent argLabel , DevExpress.XtraGauges.Win.Gauges.Circular.ArcScaleRangeBarComponent arcRangeBar) { argArcScale.EnableAnimation = false; argArcScale.EasingMode = DevExpress.XtraGauges.Core.Model.EasingMode.EaseIn; argArcScale.EasingFunction = new BackEase(); argArcScale.MinValue = 0; argArcScale.Value = 0; argLabel.Text = "0"; try { argArcScale.MinValue = 0; argArcScale.MaxValue = Convert.ToInt32(argDt.Rows[0]["VALUE_MAX"]); argArcScale.EnableAnimation = true; argArcScale.EasingMode = DevExpress.XtraGauges.Core.Model.EasingMode.EaseInOut; argArcScale.EasingFunction = new BackEase(); double num; double.TryParse(argDt.Rows[0]["VALUE_DATA"].ToString(), out num); argArcScale.Value = (float)num; argLabel.Text = num.ToString() + "%"; if (argEva) { lblProDMPDPlan.Text = argDt.Rows[0]["D_PLAN"].ToString(); lblProDMPRPlan.Text = argDt.Rows[0]["R_PLAN"].ToString(); lblProDMPProd.Text = argDt.Rows[0]["PROD"].ToString(); } else { lblProDMCDPlan.Text = argDt.Rows[0]["D_PLAN"].ToString(); lblProDMCRPlan.Text = argDt.Rows[0]["R_PLAN"].ToString(); lblProDMCProd.Text = argDt.Rows[0]["PROD"].ToString(); } if (num > 98) { arcRangeBar.Shader = new DevExpress.XtraGauges.Core.Drawing.StyleShader("Colors[Style1:Green;Style2:Green]"); } else if (num >= 95) { arcRangeBar.Shader = new DevExpress.XtraGauges.Core.Drawing.StyleShader("Colors[Style1:Yellow;Style2:Yellow]"); } else { arcRangeBar.Shader = new DevExpress.XtraGauges.Core.Drawing.StyleShader("Colors[Style1:Red;Style2:Red]"); } } catch { } // } }
private void loadChartAbsent(DevExpress.XtraGauges.Win.Gauges.Circular.ArcScaleComponent arcScaleComponent , DevExpress.XtraCharts.ChartControl argChart , DevExpress.XtraGauges.Win.Base.LabelComponent arglbl , string argPer, string argPlan, string argNoPlan) { try { float value = 0; //Chart Per arcScaleComponent.EnableAnimation = false; arcScaleComponent.EasingMode = DevExpress.XtraGauges.Core.Model.EasingMode.EaseInOut; arcScaleComponent.EasingFunction = new BackEase(); arglbl.Text = "0"; arcScaleComponent.Value = 0; arcScaleComponent.EnableAnimation = true; arcScaleComponent.EasingMode = DevExpress.XtraGauges.Core.Model.EasingMode.EaseInOut; arcScaleComponent.EasingFunction = new BackEase(); arglbl.Text = argPer; float.TryParse(argPer, out value); arglbl.Text = value.ToString("##0.#"); arcScaleComponent.Value = value; arcScaleComponent.MinValue = 0f; arcScaleComponent.MaxValue = 20f; //arcScaleComponent.Ranges[0].StartValue = 0; //arcScaleComponent.Ranges[0].EndValue = arcScaleComponent.Ranges[1].StartValue = (float)9; ; //arcScaleComponent.Ranges[1].EndValue = arcScaleComponent.Ranges[2].StartValue = (float)10; //arcScaleComponent.Ranges[2].EndValue = (float)10; //Chart Absent /*DataTable dt_tmp = new DataTable(); * dt_tmp.Columns.Add("CAPTION"); * dt_tmp.Columns.Add("VALUE", typeof(double)); * * dt_tmp.Rows.Add(); * dt_tmp.Rows[0]["CAPTION"] = "NO PLAN"; * dt_tmp.Rows[0]["VALUE"] = argNoPlan == "" ? "0" : argNoPlan; * dt_tmp.Rows.Add(); * dt_tmp.Rows[1]["CAPTION"] = "PLAN"; * dt_tmp.Rows[1]["VALUE"] = argPlan; * * argChart.DataSource = dt_tmp; * argChart.Series[0].ArgumentDataMember = "CAPTION"; * argChart.Series[0].ValueDataMembers.AddRange(new string[] { "VALUE" }); * argChart.Series[0].ArgumentScaleType = DevExpress.XtraCharts.ScaleType.Qualitative; * */ } catch { } }
private void loadChartAbsent(DevExpress.XtraGauges.Win.Gauges.Circular.ArcScaleComponent arcScaleComponent , DevExpress.XtraCharts.ChartControl argChart , DevExpress.XtraGauges.Win.Base.LabelComponent arglbl , string argPer, string argPlan, string argNoPlan) { //Chart Per arcScaleComponent.EnableAnimation = false; arcScaleComponent.EasingMode = DevExpress.XtraGauges.Core.Model.EasingMode.EaseInOut; arcScaleComponent.EasingFunction = new BackEase(); arglbl.Text = "0"; arcScaleComponent.Value = 0; arcScaleComponent.EnableAnimation = true; arcScaleComponent.EasingMode = DevExpress.XtraGauges.Core.Model.EasingMode.EaseInOut; arcScaleComponent.EasingFunction = new BackEase(); arglbl.Text = argPer; arcScaleComponent.Value = Convert.ToSingle(argPer); arcScaleComponent.MaxValue = (float)1; arcScaleComponent.Ranges[0].StartValue = 0; arcScaleComponent.Ranges[0].EndValue = arcScaleComponent.Ranges[1].StartValue = (float)0.9;; arcScaleComponent.Ranges[1].EndValue = arcScaleComponent.Ranges[2].StartValue = (float)1.0; arcScaleComponent.Ranges[2].EndValue = (float)1; //Chart Absent DataTable dt_tmp = new DataTable(); dt_tmp.Columns.Add("CAPTION"); dt_tmp.Columns.Add("VALUE", typeof(double)); dt_tmp.Rows.Add(); dt_tmp.Rows[0]["CAPTION"] = "NO PLAN"; dt_tmp.Rows[0]["VALUE"] = argNoPlan == "" ? "0" : argNoPlan; dt_tmp.Rows.Add(); dt_tmp.Rows[1]["CAPTION"] = "PLAN"; dt_tmp.Rows[1]["VALUE"] = argPlan; argChart.DataSource = dt_tmp; argChart.Series[0].ArgumentDataMember = "CAPTION"; argChart.Series[0].ValueDataMembers.AddRange(new string[] { "VALUE" }); argChart.Series[0].ArgumentScaleType = DevExpress.XtraCharts.ScaleType.Qualitative; }
private void chartGaugesProd(DataTable argDt, bool argEva, DevExpress.XtraGauges.Win.Gauges.Circular.ArcScaleComponent argArcScale , DevExpress.XtraGauges.Win.Base.LabelComponent argLabel , DevExpress.XtraGauges.Win.Gauges.Circular.ArcScaleRangeBarComponent arcRangeBar) { // DataTable dt = SEL_FG_DAYS_INV("014", Mline); argArcScale.EnableAnimation = false; argArcScale.EasingMode = DevExpress.XtraGauges.Core.Model.EasingMode.EaseIn; argArcScale.EasingFunction = new BackEase(); argArcScale.MinValue = 0; argArcScale.MaxValue = Convert.ToInt32(argDt.Rows[0]["VALUE_MAX"]); //arcScaleGauges.Ranges[0].EndValue = arcScaleGauges.Ranges[1].StartValue = Convert.ToSingle(10); //arcScaleGauges.Ranges[1].EndValue = arcScaleGauges.Ranges[2].StartValue = Convert.ToSingle(15); //arcScaleGauges.Ranges[2].EndValue = Convert.ToSingle(20); argArcScale.Value = 0; argLabel.Text = "0"; try { argArcScale.MinValue = 0; argArcScale.MaxValue = Convert.ToInt32(argDt.Rows[0]["VALUE_MAX"]); argArcScale.EnableAnimation = true; argArcScale.EasingMode = DevExpress.XtraGauges.Core.Model.EasingMode.EaseInOut; argArcScale.EasingFunction = new BackEase(); double num; double.TryParse(argDt.Rows[0]["VALUE_DATA"].ToString(), out num); argArcScale.Value = (float)num; argLabel.Text = num.ToString() + "%"; if (argEva) { lblProEvaDPlan.Text = argDt.Rows[0]["D_PLAN"].ToString(); lblProEvaRPlan.Text = argDt.Rows[0]["R_PLAN"].ToString(); lblProEvaProd.Text = argDt.Rows[0]["PROD"].ToString(); } else { lblProRubDPlan.Text = argDt.Rows[0]["D_PLAN"].ToString(); lblProRubRPlan.Text = argDt.Rows[0]["R_PLAN"].ToString(); lblProRubProd.Text = argDt.Rows[0]["PROD"].ToString(); } if (num > 85) { arcRangeBar.Shader = new DevExpress.XtraGauges.Core.Drawing.StyleShader("Colors[Style1:Green;Style2:]"); } else if (num > 80) { arcRangeBar.Shader = new DevExpress.XtraGauges.Core.Drawing.StyleShader("Colors[Style1:Yellow;Style2:]"); } else { arcRangeBar.Shader = new DevExpress.XtraGauges.Core.Drawing.StyleShader("Colors[Style1:Red;Style2:]"); } // lblTar.Text = argDt.Rows[0]["TARGET"].ToString(); // lblProd.Text = argDt.Rows[0]["PROD_QTY"].ToString(); } catch { } // } }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FRM_SMT_HR_ABSENT_PHUOC)); DevExpress.XtraCharts.SimpleDiagram simpleDiagram1 = new DevExpress.XtraCharts.SimpleDiagram(); DevExpress.XtraCharts.Series series1 = new DevExpress.XtraCharts.Series(); DevExpress.XtraCharts.PieSeriesLabel pieSeriesLabel1 = new DevExpress.XtraCharts.PieSeriesLabel(); DevExpress.XtraCharts.PieSeriesView pieSeriesView1 = new DevExpress.XtraCharts.PieSeriesView(); DevExpress.XtraCharts.PieFlyInAnimation pieFlyInAnimation1 = new DevExpress.XtraCharts.PieFlyInAnimation(); DevExpress.XtraCharts.ChartTitle chartTitle1 = new DevExpress.XtraCharts.ChartTitle(); this.pnHeader = new System.Windows.Forms.Panel(); this.simpleButton4 = new DevExpress.XtraEditors.SimpleButton(); this.simpleButton3 = new DevExpress.XtraEditors.SimpleButton(); this.simpleButton2 = new DevExpress.XtraEditors.SimpleButton(); this.simpleButton1 = new DevExpress.XtraEditors.SimpleButton(); this.cmdBack = new System.Windows.Forms.Button(); this.lblDate = new System.Windows.Forms.Label(); this.lblTitle = new DevExpress.XtraEditors.LabelControl(); this.axfpAbsent = new AxFPSpreadADO.AxfpSpread(); this.tmrDate = new System.Windows.Forms.Timer(); this.arcScaleComponent2 = new DevExpress.XtraGauges.Win.Gauges.Circular.ArcScaleComponent(); this.gaugeControl1 = new DevExpress.XtraGauges.Win.GaugeControl(); this.cGauge1 = new DevExpress.XtraGauges.Win.Gauges.Circular.CircularGauge(); this.arcScaleBackgroundLayerComponent1 = new DevExpress.XtraGauges.Win.Gauges.Circular.ArcScaleBackgroundLayerComponent(); this.arcScaleComponentRub = new DevExpress.XtraGauges.Win.Gauges.Circular.ArcScaleComponent(); this.labelComponent1 = new DevExpress.XtraGauges.Win.Base.LabelComponent(); this.lblRubValueG = new DevExpress.XtraGauges.Win.Base.LabelComponent(); this.lblTitleGauges = new DevExpress.XtraGauges.Win.Base.LabelComponent(); this.arcScaleNeedleComponent1 = new DevExpress.XtraGauges.Win.Gauges.Circular.ArcScaleNeedleComponent(); this.arcScaleSpindleCapComponent1 = new DevExpress.XtraGauges.Win.Gauges.Circular.ArcScaleSpindleCapComponent(); this.chartHrCmp = new DevExpress.XtraCharts.ChartControl(); this.label21 = new System.Windows.Forms.Label(); this.lblAbenst2 = new System.Windows.Forms.Label(); this.lblAbenst1 = new System.Windows.Forms.Label(); this.lblTotAbsent = new System.Windows.Forms.Label(); this.uc_month = new FORM.UC.UC_MONTH_SELECTION(); this.uc_year = new FORM.UC.UC_YEAR_SELECTION(); this.pnHeader.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.axfpAbsent)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.arcScaleComponent2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.cGauge1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.arcScaleBackgroundLayerComponent1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.arcScaleComponentRub)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.labelComponent1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.lblRubValueG)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.lblTitleGauges)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.arcScaleNeedleComponent1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.arcScaleSpindleCapComponent1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.chartHrCmp)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(simpleDiagram1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(series1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(pieSeriesLabel1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(pieSeriesView1)).BeginInit(); this.SuspendLayout(); // // pnHeader // this.pnHeader.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(192))))); this.pnHeader.Controls.Add(this.simpleButton4); this.pnHeader.Controls.Add(this.simpleButton3); this.pnHeader.Controls.Add(this.simpleButton2); this.pnHeader.Controls.Add(this.simpleButton1); this.pnHeader.Controls.Add(this.cmdBack); this.pnHeader.Controls.Add(this.lblDate); this.pnHeader.Controls.Add(this.lblTitle); this.pnHeader.Dock = System.Windows.Forms.DockStyle.Top; this.pnHeader.Location = new System.Drawing.Point(0, 0); this.pnHeader.Name = "pnHeader"; this.pnHeader.Size = new System.Drawing.Size(1916, 110); this.pnHeader.TabIndex = 12; // // simpleButton4 // this.simpleButton4.Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); this.simpleButton4.Appearance.BackColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); this.simpleButton4.Appearance.Font = new System.Drawing.Font("Calibri", 24F, System.Drawing.FontStyle.Bold); this.simpleButton4.Appearance.GradientMode = System.Drawing.Drawing2D.LinearGradientMode.ForwardDiagonal; this.simpleButton4.Appearance.Options.UseBackColor = true; this.simpleButton4.Appearance.Options.UseFont = true; this.simpleButton4.ButtonStyle = DevExpress.XtraEditors.Controls.BorderStyles.Flat; this.simpleButton4.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("simpleButton4.ImageOptions.Image"))); this.simpleButton4.Location = new System.Drawing.Point(1478, 54); this.simpleButton4.Name = "simpleButton4"; this.simpleButton4.Size = new System.Drawing.Size(175, 48); this.simpleButton4.TabIndex = 52; this.simpleButton4.Text = "Year"; this.simpleButton4.Click += new System.EventHandler(this.simpleButton4_Click); // // simpleButton3 // this.simpleButton3.Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); this.simpleButton3.Appearance.BackColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); this.simpleButton3.Appearance.Font = new System.Drawing.Font("Calibri", 24F, System.Drawing.FontStyle.Bold); this.simpleButton3.Appearance.GradientMode = System.Drawing.Drawing2D.LinearGradientMode.ForwardDiagonal; this.simpleButton3.Appearance.Options.UseBackColor = true; this.simpleButton3.Appearance.Options.UseFont = true; this.simpleButton3.ButtonStyle = DevExpress.XtraEditors.Controls.BorderStyles.Flat; this.simpleButton3.Enabled = false; this.simpleButton3.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("simpleButton3.ImageOptions.Image"))); this.simpleButton3.Location = new System.Drawing.Point(1479, 3); this.simpleButton3.Name = "simpleButton3"; this.simpleButton3.Size = new System.Drawing.Size(175, 48); this.simpleButton3.TabIndex = 51; this.simpleButton3.Text = "Month"; this.simpleButton3.Click += new System.EventHandler(this.simpleButton3_Click); // // simpleButton2 // this.simpleButton2.Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); this.simpleButton2.Appearance.BackColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); this.simpleButton2.Appearance.Font = new System.Drawing.Font("Calibri", 24F, System.Drawing.FontStyle.Bold); this.simpleButton2.Appearance.GradientMode = System.Drawing.Drawing2D.LinearGradientMode.ForwardDiagonal; this.simpleButton2.Appearance.Options.UseBackColor = true; this.simpleButton2.Appearance.Options.UseFont = true; this.simpleButton2.ButtonStyle = DevExpress.XtraEditors.Controls.BorderStyles.Flat; this.simpleButton2.Enabled = false; this.simpleButton2.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("simpleButton2.ImageOptions.Image"))); this.simpleButton2.Location = new System.Drawing.Point(1297, 54); this.simpleButton2.Name = "simpleButton2"; this.simpleButton2.Size = new System.Drawing.Size(175, 48); this.simpleButton2.TabIndex = 51; this.simpleButton2.Text = "Week"; // // simpleButton1 // this.simpleButton1.Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); this.simpleButton1.Appearance.BackColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); this.simpleButton1.Appearance.Font = new System.Drawing.Font("Calibri", 24F, System.Drawing.FontStyle.Bold); this.simpleButton1.Appearance.GradientMode = System.Drawing.Drawing2D.LinearGradientMode.ForwardDiagonal; this.simpleButton1.Appearance.Options.UseBackColor = true; this.simpleButton1.Appearance.Options.UseFont = true; this.simpleButton1.ButtonStyle = DevExpress.XtraEditors.Controls.BorderStyles.Flat; this.simpleButton1.Enabled = false; this.simpleButton1.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("simpleButton1.ImageOptions.Image"))); this.simpleButton1.Location = new System.Drawing.Point(1298, 3); this.simpleButton1.Name = "simpleButton1"; this.simpleButton1.Size = new System.Drawing.Size(175, 48); this.simpleButton1.TabIndex = 51; this.simpleButton1.Text = "Day"; this.simpleButton1.Click += new System.EventHandler(this.simpleButton1_Click); // // cmdBack // this.cmdBack.BackColor = System.Drawing.Color.Transparent; this.cmdBack.BackgroundImage = global::FORM.Properties.Resources.Back_Icon; this.cmdBack.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.cmdBack.FlatAppearance.BorderColor = System.Drawing.Color.Yellow; this.cmdBack.FlatAppearance.BorderSize = 0; this.cmdBack.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.cmdBack.Location = new System.Drawing.Point(1183, 7); this.cmdBack.Name = "cmdBack"; this.cmdBack.Size = new System.Drawing.Size(108, 101); this.cmdBack.TabIndex = 50; this.cmdBack.UseVisualStyleBackColor = false; this.cmdBack.Click += new System.EventHandler(this.button1_Click); // // lblDate // this.lblDate.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.lblDate.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(192))))); this.lblDate.Font = new System.Drawing.Font("Calibri", 32.25F, System.Drawing.FontStyle.Bold); this.lblDate.ForeColor = System.Drawing.Color.White; this.lblDate.ImageAlign = System.Drawing.ContentAlignment.TopLeft; this.lblDate.Location = new System.Drawing.Point(1660, 0); this.lblDate.Name = "lblDate"; this.lblDate.Size = new System.Drawing.Size(265, 106); this.lblDate.TabIndex = 49; this.lblDate.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // lblTitle // this.lblTitle.Appearance.BackColor = System.Drawing.Color.Transparent; this.lblTitle.Appearance.Font = new System.Drawing.Font("Calibri", 62F, System.Drawing.FontStyle.Bold); this.lblTitle.Appearance.ForeColor = System.Drawing.Color.White; this.lblTitle.Appearance.Options.UseBackColor = true; this.lblTitle.Appearance.Options.UseFont = true; this.lblTitle.Appearance.Options.UseForeColor = true; this.lblTitle.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.None; this.lblTitle.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(192))))); this.lblTitle.LineVisible = true; this.lblTitle.Location = new System.Drawing.Point(12, 0); this.lblTitle.Name = "lblTitle"; this.lblTitle.Size = new System.Drawing.Size(1901, 107); this.lblTitle.TabIndex = 2; this.lblTitle.Text = "Human Absenteeism by Month"; // // axfpAbsent // this.axfpAbsent.DataSource = null; this.axfpAbsent.Location = new System.Drawing.Point(5, 170); this.axfpAbsent.Name = "axfpAbsent"; this.axfpAbsent.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axfpAbsent.OcxState"))); this.axfpAbsent.Size = new System.Drawing.Size(1914, 422); this.axfpAbsent.TabIndex = 0; // // tmrDate // this.tmrDate.Interval = 1000; this.tmrDate.Tick += new System.EventHandler(this.tmrDate_Tick); // // arcScaleComponent2 // this.arcScaleComponent2.AppearanceMajorTickmark.BorderBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:White"); this.arcScaleComponent2.AppearanceMajorTickmark.ContentBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:White"); this.arcScaleComponent2.AppearanceMinorTickmark.BorderBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:White"); this.arcScaleComponent2.AppearanceMinorTickmark.ContentBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:White"); this.arcScaleComponent2.AppearanceTickmarkText.TextBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Gainsboro"); this.arcScaleComponent2.Center = new DevExpress.XtraGauges.Core.Base.PointF2D(125F, 165F); this.arcScaleComponent2.EndAngle = 0F; this.arcScaleComponent2.MajorTickCount = 7; this.arcScaleComponent2.MajorTickmark.FormatString = "{0:F0}"; this.arcScaleComponent2.MajorTickmark.ShapeOffset = -2F; this.arcScaleComponent2.MajorTickmark.ShapeType = DevExpress.XtraGauges.Core.Model.TickmarkShapeType.Circular_Style13_2; this.arcScaleComponent2.MajorTickmark.TextOffset = -15F; this.arcScaleComponent2.MajorTickmark.TextOrientation = DevExpress.XtraGauges.Core.Model.LabelOrientation.LeftToRight; this.arcScaleComponent2.MaxValue = 800F; this.arcScaleComponent2.MinorTickCount = 4; this.arcScaleComponent2.MinorTickmark.ShapeType = DevExpress.XtraGauges.Core.Model.TickmarkShapeType.Circular_Style13_1; this.arcScaleComponent2.MinValue = 200F; this.arcScaleComponent2.Name = "scale2"; this.arcScaleComponent2.RadiusX = 65F; this.arcScaleComponent2.RadiusY = 65F; this.arcScaleComponent2.StartAngle = -180F; this.arcScaleComponent2.Value = 300F; this.arcScaleComponent2.ZOrder = -1; // // gaugeControl1 // this.gaugeControl1.AutoLayout = false; this.gaugeControl1.Gauges.AddRange(new DevExpress.XtraGauges.Base.IGauge[] { this.cGauge1}); this.gaugeControl1.Location = new System.Drawing.Point(18, 677); this.gaugeControl1.Name = "gaugeControl1"; this.gaugeControl1.Size = new System.Drawing.Size(929, 380); this.gaugeControl1.TabIndex = 18; // // cGauge1 // this.cGauge1.BackgroundLayers.AddRange(new DevExpress.XtraGauges.Win.Gauges.Circular.ArcScaleBackgroundLayerComponent[] { this.arcScaleBackgroundLayerComponent1}); this.cGauge1.Bounds = new System.Drawing.Rectangle(6, 6, 916, 370); this.cGauge1.Labels.AddRange(new DevExpress.XtraGauges.Win.Base.LabelComponent[] { this.labelComponent1, this.lblRubValueG, this.lblTitleGauges}); this.cGauge1.Name = "cGauge1"; this.cGauge1.Needles.AddRange(new DevExpress.XtraGauges.Win.Gauges.Circular.ArcScaleNeedleComponent[] { this.arcScaleNeedleComponent1}); this.cGauge1.Scales.AddRange(new DevExpress.XtraGauges.Win.Gauges.Circular.ArcScaleComponent[] { this.arcScaleComponentRub}); this.cGauge1.SpindleCaps.AddRange(new DevExpress.XtraGauges.Win.Gauges.Circular.ArcScaleSpindleCapComponent[] { this.arcScaleSpindleCapComponent1}); // // arcScaleBackgroundLayerComponent1 // this.arcScaleBackgroundLayerComponent1.ArcScale = this.arcScaleComponentRub; this.arcScaleBackgroundLayerComponent1.Name = "bg1"; this.arcScaleBackgroundLayerComponent1.ScaleCenterPos = new DevExpress.XtraGauges.Core.Base.PointF2D(0.5F, 0.7F); this.arcScaleBackgroundLayerComponent1.ShapeType = DevExpress.XtraGauges.Core.Model.BackgroundLayerShapeType.CircularHalf_Style4; this.arcScaleBackgroundLayerComponent1.Size = new System.Drawing.SizeF(350F, 248F); this.arcScaleBackgroundLayerComponent1.ZOrder = 1000; // // arcScaleComponentRub // this.arcScaleComponentRub.AppearanceMajorTickmark.BorderBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:White"); this.arcScaleComponentRub.AppearanceMajorTickmark.ContentBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:White"); this.arcScaleComponentRub.AppearanceMinorTickmark.BorderBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:White"); this.arcScaleComponentRub.AppearanceMinorTickmark.ContentBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:White"); this.arcScaleComponentRub.AppearanceTickmarkText.Font = new System.Drawing.Font("Tahoma", 16F, System.Drawing.FontStyle.Bold); this.arcScaleComponentRub.AppearanceTickmarkText.TextBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Black"); this.arcScaleComponentRub.Center = new DevExpress.XtraGauges.Core.Base.PointF2D(151F, 150F); this.arcScaleComponentRub.EndAngle = 0F; this.arcScaleComponentRub.MajorTickmark.FormatString = "{0:F0}"; this.arcScaleComponentRub.MajorTickmark.ShapeOffset = -14F; this.arcScaleComponentRub.MajorTickmark.ShapeScale = new DevExpress.XtraGauges.Core.Base.FactorF2D(0.6F, 0.8F); this.arcScaleComponentRub.MajorTickmark.ShapeType = DevExpress.XtraGauges.Core.Model.TickmarkShapeType.Circular_Style4_2; this.arcScaleComponentRub.MajorTickmark.TextOffset = -40F; this.arcScaleComponentRub.MajorTickmark.TextOrientation = DevExpress.XtraGauges.Core.Model.LabelOrientation.LeftToRight; this.arcScaleComponentRub.MaxValue = 10F; this.arcScaleComponentRub.MinorTickCount = 0; this.arcScaleComponentRub.MinorTickmark.ShapeOffset = -7F; this.arcScaleComponentRub.MinorTickmark.ShapeScale = new DevExpress.XtraGauges.Core.Base.FactorF2D(0.6F, 1F); this.arcScaleComponentRub.MinorTickmark.ShapeType = DevExpress.XtraGauges.Core.Model.TickmarkShapeType.Circular_Style4_1; this.arcScaleComponentRub.MinorTickmark.ShowTick = false; this.arcScaleComponentRub.Name = "scale1"; this.arcScaleComponentRub.RadiusX = 170F; this.arcScaleComponentRub.RadiusY = 170F; this.arcScaleComponentRub.StartAngle = -180F; this.arcScaleComponentRub.Value = 6F; // // labelComponent1 // this.labelComponent1.Name = "labelComponent1"; // // lblRubValueG // this.lblRubValueG.AppearanceText.Font = new System.Drawing.Font("Calibri", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblRubValueG.AppearanceText.TextBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:White"); this.lblRubValueG.Name = "cGauge1_Label2"; this.lblRubValueG.Position = new DevExpress.XtraGauges.Core.Base.PointF2D(150.3F, 90.1F); this.lblRubValueG.Size = new System.Drawing.SizeF(125F, 50F); this.lblRubValueG.ZOrder = -1001; // // lblTitleGauges // this.lblTitleGauges.AppearanceText.Font = new System.Drawing.Font("Tahoma", 20F); this.lblTitleGauges.AppearanceText.TextBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Black"); this.lblTitleGauges.Name = "cGauge1_Label3"; this.lblTitleGauges.Position = new DevExpress.XtraGauges.Core.Base.PointF2D(160.4F, -50.7F); this.lblTitleGauges.Size = new System.Drawing.SizeF(300F, 25F); this.lblTitleGauges.Text = "Attendance AVG (%)"; this.lblTitleGauges.ZOrder = -1001; // // arcScaleNeedleComponent1 // this.arcScaleNeedleComponent1.ArcScale = this.arcScaleComponentRub; this.arcScaleNeedleComponent1.EndOffset = 5F; this.arcScaleNeedleComponent1.Name = "needle1"; this.arcScaleNeedleComponent1.ShapeType = DevExpress.XtraGauges.Core.Model.NeedleShapeType.CircularFull_Style4; this.arcScaleNeedleComponent1.StartOffset = -21F; this.arcScaleNeedleComponent1.ZOrder = -50; // // arcScaleSpindleCapComponent1 // this.arcScaleSpindleCapComponent1.ArcScale = this.arcScaleComponentRub; this.arcScaleSpindleCapComponent1.Name = "cap1"; this.arcScaleSpindleCapComponent1.ShapeType = DevExpress.XtraGauges.Core.Model.SpindleCapShapeType.CircularFull_Style4; this.arcScaleSpindleCapComponent1.Size = new System.Drawing.SizeF(16F, 16F); this.arcScaleSpindleCapComponent1.ZOrder = -100; // // chartHrCmp // this.chartHrCmp.AnimationStartMode = DevExpress.XtraCharts.ChartAnimationMode.OnDataChanged; this.chartHrCmp.BackColor = System.Drawing.Color.Transparent; this.chartHrCmp.DataBindings = null; simpleDiagram1.LabelsResolveOverlappingMinIndent = 40; this.chartHrCmp.Diagram = simpleDiagram1; this.chartHrCmp.IndicatorsPaletteName = "Palette 1"; this.chartHrCmp.IndicatorsPaletteRepository.Add("Palette 1", new DevExpress.XtraCharts.Palette("Palette 1", DevExpress.XtraCharts.PaletteScaleMode.Repeat, new DevExpress.XtraCharts.PaletteEntry[] { new DevExpress.XtraCharts.PaletteEntry(System.Drawing.Color.Red, System.Drawing.Color.Red), new DevExpress.XtraCharts.PaletteEntry(System.Drawing.Color.Green, System.Drawing.Color.Green)})); this.chartHrCmp.Legend.AlignmentHorizontal = DevExpress.XtraCharts.LegendAlignmentHorizontal.Right; this.chartHrCmp.Legend.AlignmentVertical = DevExpress.XtraCharts.LegendAlignmentVertical.Center; this.chartHrCmp.Legend.Font = new System.Drawing.Font("Tahoma", 12F); this.chartHrCmp.Legend.Name = "Default Legend"; this.chartHrCmp.Legend.Visibility = DevExpress.Utils.DefaultBoolean.False; this.chartHrCmp.Location = new System.Drawing.Point(963, 677); this.chartHrCmp.Name = "chartHrCmp"; this.chartHrCmp.PaletteName = "Absent_Red"; this.chartHrCmp.PaletteRepository.Add("Absent_Blue", new DevExpress.XtraCharts.Palette("Absent_Blue", DevExpress.XtraCharts.PaletteScaleMode.Repeat, new DevExpress.XtraCharts.PaletteEntry[] { new DevExpress.XtraCharts.PaletteEntry(System.Drawing.Color.DodgerBlue, System.Drawing.Color.DodgerBlue), new DevExpress.XtraCharts.PaletteEntry(System.Drawing.Color.Green, System.Drawing.Color.Green)})); this.chartHrCmp.PaletteRepository.Add("Absent_Red", new DevExpress.XtraCharts.Palette("Absent_Red", DevExpress.XtraCharts.PaletteScaleMode.Repeat, new DevExpress.XtraCharts.PaletteEntry[] { new DevExpress.XtraCharts.PaletteEntry(System.Drawing.Color.Yellow, System.Drawing.Color.Yellow), new DevExpress.XtraCharts.PaletteEntry(System.Drawing.Color.Red, System.Drawing.Color.Red), new DevExpress.XtraCharts.PaletteEntry(System.Drawing.Color.Green, System.Drawing.Color.Green)})); pieSeriesLabel1.Border.Color = System.Drawing.Color.Black; pieSeriesLabel1.Border.Visibility = DevExpress.Utils.DefaultBoolean.True; pieSeriesLabel1.EnableAntialiasing = DevExpress.Utils.DefaultBoolean.True; pieSeriesLabel1.FillStyle.FillMode = DevExpress.XtraCharts.FillMode.Gradient; pieSeriesLabel1.Font = new System.Drawing.Font("Calibri", 13F, System.Drawing.FontStyle.Bold); pieSeriesLabel1.LineLength = 0; pieSeriesLabel1.LineStyle.LineJoin = System.Drawing.Drawing2D.LineJoin.Bevel; pieSeriesLabel1.LineVisibility = DevExpress.Utils.DefaultBoolean.True; pieSeriesLabel1.Position = DevExpress.XtraCharts.PieSeriesLabelPosition.TwoColumns; pieSeriesLabel1.ResolveOverlappingMode = DevExpress.XtraCharts.ResolveOverlappingMode.Default; pieSeriesLabel1.TextColor = System.Drawing.Color.Black; pieSeriesLabel1.TextPattern = "{V:#,0} Person(s)\n{VP:0.0%}\n"; series1.Label = pieSeriesLabel1; series1.LabelsVisibility = DevExpress.Utils.DefaultBoolean.True; series1.Name = "Series 1"; pieSeriesView1.Animation = pieFlyInAnimation1; pieSeriesView1.MinAllowedSizePercentage = 10D; pieSeriesView1.Rotation = 90; series1.View = pieSeriesView1; this.chartHrCmp.SeriesSerializable = new DevExpress.XtraCharts.Series[] { series1}; this.chartHrCmp.Size = new System.Drawing.Size(941, 380); this.chartHrCmp.TabIndex = 19; chartTitle1.Font = new System.Drawing.Font("Tahoma", 20F); chartTitle1.Text = "Rubber"; chartTitle1.Visibility = DevExpress.Utils.DefaultBoolean.False; this.chartHrCmp.Titles.AddRange(new DevExpress.XtraCharts.ChartTitle[] { chartTitle1}); // // label21 // this.label21.BackColor = System.Drawing.Color.Green; this.label21.Font = new System.Drawing.Font("Calibri", 12.25F, System.Drawing.FontStyle.Bold); this.label21.ForeColor = System.Drawing.Color.White; this.label21.Location = new System.Drawing.Point(1375, 646); this.label21.Name = "label21"; this.label21.Size = new System.Drawing.Size(165, 28); this.label21.TabIndex = 57; this.label21.Text = "Attended"; this.label21.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // lblAbenst2 // this.lblAbenst2.BackColor = System.Drawing.Color.Red; this.lblAbenst2.Font = new System.Drawing.Font("Calibri", 12.25F, System.Drawing.FontStyle.Bold); this.lblAbenst2.ForeColor = System.Drawing.Color.White; this.lblAbenst2.Location = new System.Drawing.Point(1711, 646); this.lblAbenst2.Name = "lblAbenst2"; this.lblAbenst2.Size = new System.Drawing.Size(193, 28); this.lblAbenst2.TabIndex = 56; this.lblAbenst2.Text = "Unplanned Absenteeism"; this.lblAbenst2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // lblAbenst1 // this.lblAbenst1.BackColor = System.Drawing.Color.Yellow; this.lblAbenst1.Font = new System.Drawing.Font("Calibri", 12.25F, System.Drawing.FontStyle.Bold); this.lblAbenst1.ForeColor = System.Drawing.Color.Black; this.lblAbenst1.Location = new System.Drawing.Point(1542, 646); this.lblAbenst1.Name = "lblAbenst1"; this.lblAbenst1.Size = new System.Drawing.Size(165, 28); this.lblAbenst1.TabIndex = 55; this.lblAbenst1.Text = "Plan Absenteeism"; this.lblAbenst1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // lblTotAbsent // this.lblTotAbsent.AutoSize = true; this.lblTotAbsent.Font = new System.Drawing.Font("Calibri", 14F, System.Drawing.FontStyle.Bold); this.lblTotAbsent.ForeColor = System.Drawing.Color.Black; this.lblTotAbsent.Location = new System.Drawing.Point(1751, 695); this.lblTotAbsent.Name = "lblTotAbsent"; this.lblTotAbsent.Size = new System.Drawing.Size(109, 23); this.lblTotAbsent.TabIndex = 58; this.lblTotAbsent.Text = "Total Absent"; this.lblTotAbsent.TextAlign = System.Drawing.ContentAlignment.TopCenter; // // uc_month // this.uc_month.AutoSize = true; this.uc_month.Location = new System.Drawing.Point(5, 118); this.uc_month.Name = "uc_month"; this.uc_month.Size = new System.Drawing.Size(472, 46); this.uc_month.TabIndex = 59; this.uc_month.ValueChangeEvent += new System.EventHandler(this.uc_month_ValueChangeEvent); // // uc_year // this.uc_year.AutoSize = true; this.uc_year.Location = new System.Drawing.Point(7, 117); this.uc_year.Name = "uc_year"; this.uc_year.Size = new System.Drawing.Size(229, 47); this.uc_year.TabIndex = 60; this.uc_year.ValueChangeEvent += new System.EventHandler(this.uc_month_ValueChangeEvent); // // FRM_SMT_HR_ABSENT_PHUOC // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.BackColor = System.Drawing.Color.White; this.ClientSize = new System.Drawing.Size(1916, 1054); this.Controls.Add(this.uc_year); this.Controls.Add(this.uc_month); this.Controls.Add(this.lblTotAbsent); this.Controls.Add(this.label21); this.Controls.Add(this.lblAbenst2); this.Controls.Add(this.lblAbenst1); this.Controls.Add(this.chartHrCmp); this.Controls.Add(this.gaugeControl1); this.Controls.Add(this.pnHeader); this.Controls.Add(this.axfpAbsent); this.Name = "FRM_SMT_HR_ABSENT_PHUOC"; this.Text = "FRM_SMT_HR_ABSENT"; this.Load += new System.EventHandler(this.FRM_SMT_HR_ABSENT_Load); this.VisibleChanged += new System.EventHandler(this.FRM_SMT_HR_ABSENT_VisibleChanged); this.pnHeader.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.axfpAbsent)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.arcScaleComponent2)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.cGauge1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.arcScaleBackgroundLayerComponent1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.arcScaleComponentRub)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.labelComponent1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.lblRubValueG)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.lblTitleGauges)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.arcScaleNeedleComponent1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.arcScaleSpindleCapComponent1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(simpleDiagram1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(pieSeriesLabel1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(pieSeriesView1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(series1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.chartHrCmp)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); }
private void chartPOD(DevExpress.XtraGauges.Win.Gauges.Circular.ArcScaleComponent arcScaleComponent , DevExpress.XtraGauges.Win.Base.LabelComponent arglbl , string argPer, string argYellow, string argGreen, string argMax) { try { //Chart Per DevExpress.XtraGauges.Core.Model.ArcScaleRange arcScaleRangeRed = new DevExpress.XtraGauges.Core.Model.ArcScaleRange(); DevExpress.XtraGauges.Core.Model.ArcScaleRange arcScaleRangeYellow = new DevExpress.XtraGauges.Core.Model.ArcScaleRange(); DevExpress.XtraGauges.Core.Model.ArcScaleRange arcScaleRangeGreen = new DevExpress.XtraGauges.Core.Model.ArcScaleRange(); float fValue = Convert.ToSingle(argPer); float fMaxValue = Convert.ToSingle(argMax); string strMaxValue = argMax; arcScaleComponent.EnableAnimation = false; arcScaleComponent.EasingMode = DevExpress.XtraGauges.Core.Model.EasingMode.EaseInOut; arcScaleComponent.EasingFunction = new BackEase(); arglbl.Text = "0"; arcScaleComponent.Value = 0; arcScaleComponent.EnableAnimation = true; arcScaleComponent.EasingMode = DevExpress.XtraGauges.Core.Model.EasingMode.EaseInOut; arcScaleComponent.EasingFunction = new BackEase(); arglbl.Text = argPer; arcScaleComponent.Value = fValue; arcScaleComponent.Ranges.Clear(); //if (fValue >= Convert.ToDouble(argGreen)) //{ // arglbl.AppearanceText.TextBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Green"); //} //else if (fValue > Convert.ToDouble(argYellow)) //{ // arglbl.AppearanceText.TextBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Yellow"); //} //else //{ // arglbl.AppearanceText.TextBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Red"); //} //if (fValue > fMaxValue) //{ // strMaxValue = (fValue + 1).ToString(); // arcScaleComponent.MaxValue = Convert.ToSingle(strMaxValue); //} //else //{ // arcScaleComponent.MaxValue = fMaxValue +1; //} if (fValue >= Convert.ToDouble(argGreen)) { arglbl.AppearanceText.TextBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Green"); arcScaleRangeGreen.StartThickness = 18; arcScaleRangeGreen.EndThickness = 18; arcScaleRangeGreen.Name = "Range2"; arcScaleRangeGreen.ShapeOffset = -10F; arcScaleRangeGreen.StartValue = 0; arcScaleRangeGreen.EndValue = Convert.ToSingle(fValue); arcScaleRangeGreen.AppearanceRange.ContentBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Green"); arcScaleComponent.Ranges.AddRange(new DevExpress.XtraGauges.Core.Model.IRange[] { arcScaleRangeGreen }); } else if (fValue > Convert.ToDouble(argYellow)) { arglbl.AppearanceText.TextBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Yellow"); arcScaleRangeYellow.StartThickness = 18; arcScaleRangeYellow.EndThickness = 18; arcScaleRangeYellow.Name = "Range1"; arcScaleRangeYellow.ShapeOffset = -10F; arcScaleRangeYellow.StartValue = 0; arcScaleRangeYellow.EndValue = Convert.ToSingle(fValue); arcScaleRangeYellow.AppearanceRange.ContentBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Yellow"); arcScaleComponent.Ranges.AddRange(new DevExpress.XtraGauges.Core.Model.IRange[] { arcScaleRangeYellow }); } else { arglbl.AppearanceText.TextBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Red"); arcScaleRangeRed.StartThickness = 18; arcScaleRangeRed.EndThickness = 18; arcScaleRangeRed.Name = "Range0"; arcScaleRangeRed.ShapeOffset = -10F; arcScaleRangeRed.EndValue = Convert.ToSingle(fValue); arcScaleRangeRed.AppearanceRange.ContentBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Red"); arcScaleComponent.Ranges.AddRange(new DevExpress.XtraGauges.Core.Model.IRange[] { arcScaleRangeRed }); } //AddRange(arcScaleComponent, "0", argYellow, argGreen, strMaxValue); } catch { } }
private void chartOSD2(DataTable argDt, DevExpress.XtraGauges.Win.Gauges.Circular.ArcScaleComponent arcScaleComponent , DevExpress.XtraGauges.Win.Base.LabelComponent arglbl ) { try { //Chart Per if (argDt.Rows.Count > 0) { arcScaleComponent.Ranges.Clear(); DevExpress.XtraGauges.Core.Model.ArcScaleRange arcScaleRange = new DevExpress.XtraGauges.Core.Model.ArcScaleRange(); arcScaleComponent.EnableAnimation = false; arcScaleComponent.EasingMode = DevExpress.XtraGauges.Core.Model.EasingMode.EaseInOut; arcScaleComponent.EasingFunction = new BackEase(); arglbl.Text = "0"; arcScaleComponent.Value = 0; double dProd, dOsd; double.TryParse(argDt.Rows[0][1].ToString(), out dOsd); double.TryParse(argDt.Rows[1][1].ToString(), out dProd); float fValue = 0; if (dOsd + dProd == 0 || dProd == 0) { fValue = 0; } else { fValue = Convert.ToSingle(Math.Round(dOsd / (dOsd + dProd) * 100, 2)); } arcScaleComponent.EnableAnimation = true; arcScaleComponent.EasingMode = DevExpress.XtraGauges.Core.Model.EasingMode.EaseInOut; arcScaleComponent.EasingFunction = new BackEase(); arcScaleComponent.Value = fValue; arglbl.Text = fValue + "%"; arcScaleRange.StartThickness = 18; arcScaleRange.EndThickness = 18; arcScaleRange.StartValue = 0; arcScaleRange.Name = "Range0"; arcScaleRange.ShapeOffset = 29F; arcScaleComponent.Ranges.Clear(); if (fValue > 4) { arcScaleRange.EndValue = 4; } else { arcScaleRange.EndValue = fValue; } if (fValue < Convert.ToDouble(argDt.Rows[0]["Target"].ToString())) { arcScaleRange.AppearanceRange.ContentBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Green"); arcScaleComponent.Ranges.AddRange(new DevExpress.XtraGauges.Core.Model.IRange[] { arcScaleRange }); arglbl.AppearanceText.TextBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Green"); } else { arcScaleRange.AppearanceRange.ContentBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Red"); arcScaleComponent.Ranges.AddRange(new DevExpress.XtraGauges.Core.Model.IRange[] { arcScaleRange }); arglbl.AppearanceText.TextBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Red"); } } } catch { } }
private void chartGaugesInv(DataTable argDt, bool argEva , DevExpress.XtraGauges.Win.Gauges.Circular.ArcScaleComponent argArcScale , DevExpress.XtraGauges.Win.Gauges.Circular.ArcScaleRangeBarComponent arcRangeBar , DevExpress.XtraGauges.Win.Base.LabelComponent argLabelDay , DevExpress.XtraGauges.Win.Base.LabelComponent argLabePlan , DevExpress.XtraGauges.Win.Base.LabelComponent argLabeTon) { try { argArcScale.EnableAnimation = false; argArcScale.EasingMode = DevExpress.XtraGauges.Core.Model.EasingMode.EaseIn; argArcScale.EasingFunction = new BackEase(); argArcScale.MinValue = 0; argArcScale.Value = 0; argLabelDay.Text = ""; argLabePlan.Text = ""; argLabeTon.Text = ""; argArcScale.MinValue = 0; argArcScale.MaxValue = Convert.ToSingle(argDt.Rows[0]["VALUE_MAX"]); argArcScale.EnableAnimation = true; argArcScale.EasingMode = DevExpress.XtraGauges.Core.Model.EasingMode.EaseInOut; argArcScale.EasingFunction = new BackEase(); double num; double.TryParse(argDt.Rows[0]["VALUE_DATA"].ToString(), out num); argArcScale.Value = (float)num; argLabelDay.Text = num.ToString("0.00"); argLabePlan.Text = argDt.Rows[0]["PLAN_DATA"].ToString(); argLabeTon.Text = argDt.Rows[0]["INV"].ToString(); if (argDt.Rows[0]["Factory"].ToString() == "DMC") { if (num > 2.5) { arcRangeBar.Shader = new DevExpress.XtraGauges.Core.Drawing.StyleShader("Colors[Style1:Red;Style2:Red]"); } else { arcRangeBar.Shader = new DevExpress.XtraGauges.Core.Drawing.StyleShader("Colors[Style1:Green;Style2:Green]"); } } else if (argDt.Rows[0]["Factory"].ToString() == "DMP") { if (num > 2.5) { arcRangeBar.Shader = new DevExpress.XtraGauges.Core.Drawing.StyleShader("Colors[Style1:Red;Style2:Red]"); } else { arcRangeBar.Shader = new DevExpress.XtraGauges.Core.Drawing.StyleShader("Colors[Style1:Green;Style2:Green]"); } } } catch { } // } }