/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); DevExpress.XtraCharts.XYDiagram xyDiagram1 = new DevExpress.XtraCharts.XYDiagram(); DevExpress.XtraCharts.RectangleGradientFillOptions rectangleGradientFillOptions1 = new DevExpress.XtraCharts.RectangleGradientFillOptions(); DevExpress.XtraCharts.SideBySideBarSeriesLabel sideBySideBarSeriesLabel1 = new DevExpress.XtraCharts.SideBySideBarSeriesLabel(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SalesItemComparsion)); this.salesByItemBindingSource = new System.Windows.Forms.BindingSource(this.components); this.panel1 = new System.Windows.Forms.Panel(); this.simpleButton1 = new DevExpress.XtraEditors.SimpleButton(); this.textEdit1 = new DevExpress.XtraEditors.TextEdit(); this.textEdit2 = new DevExpress.XtraEditors.TextEdit(); this.labelControl4 = new DevExpress.XtraEditors.LabelControl(); this.labelControl3 = new DevExpress.XtraEditors.LabelControl(); this.labelControl2 = new DevExpress.XtraEditors.LabelControl(); this.dateEdit2 = new DevExpress.XtraEditors.DateEdit(); this.labelControl1 = new DevExpress.XtraEditors.LabelControl(); this.dateEdit1 = new DevExpress.XtraEditors.DateEdit(); this.panel2 = new System.Windows.Forms.Panel(); this.gridControl1 = new DevExpress.XtraGrid.GridControl(); this.gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView(); this.colItemname = new DevExpress.XtraGrid.Columns.GridColumn(); this.colValue = new DevExpress.XtraGrid.Columns.GridColumn(); this.panel3 = new System.Windows.Forms.Panel(); this.chartControl1 = new DevExpress.XtraCharts.ChartControl(); ((System.ComponentModel.ISupportInitialize)(this.salesByItemBindingSource)).BeginInit(); this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.textEdit1.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.textEdit2.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dateEdit2.Properties.VistaTimeProperties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dateEdit2.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dateEdit1.Properties.VistaTimeProperties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dateEdit1.Properties)).BeginInit(); this.panel2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.gridControl1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.gridView1)).BeginInit(); this.panel3.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.chartControl1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(xyDiagram1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(sideBySideBarSeriesLabel1)).BeginInit(); this.SuspendLayout(); // // salesByItemBindingSource // this.salesByItemBindingSource.DataMember = "SalesByItem"; this.salesByItemBindingSource.DataSource = typeof(VIRETAILENTITIES.DsReports); // // panel1 // this.panel1.Controls.Add(this.simpleButton1); this.panel1.Controls.Add(this.textEdit1); this.panel1.Controls.Add(this.textEdit2); this.panel1.Controls.Add(this.labelControl4); this.panel1.Controls.Add(this.labelControl3); this.panel1.Controls.Add(this.labelControl2); this.panel1.Controls.Add(this.dateEdit2); this.panel1.Controls.Add(this.labelControl1); this.panel1.Controls.Add(this.dateEdit1); this.panel1.Dock = System.Windows.Forms.DockStyle.Top; this.panel1.Location = new System.Drawing.Point(0, 0); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(793, 64); this.panel1.TabIndex = 2; // // simpleButton1 // this.simpleButton1.Location = new System.Drawing.Point(408, 34); this.simpleButton1.Name = "simpleButton1"; this.simpleButton1.Size = new System.Drawing.Size(59, 20); this.simpleButton1.TabIndex = 18; this.simpleButton1.Text = "Key F10"; this.simpleButton1.Click += new System.EventHandler(this.simpleButton1_Click); // // textEdit1 // this.textEdit1.Location = new System.Drawing.Point(533, 34); this.textEdit1.Name = "textEdit1"; this.textEdit1.Size = new System.Drawing.Size(189, 20); this.textEdit1.TabIndex = 1; // // textEdit2 // this.textEdit2.EnterMoveNextControl = true; this.textEdit2.Location = new System.Drawing.Point(84, 34); this.textEdit2.Name = "textEdit2"; this.textEdit2.Size = new System.Drawing.Size(318, 20); this.textEdit2.TabIndex = 0; this.textEdit2.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textEdit2_KeyDown); // // labelControl4 // this.labelControl4.Appearance.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.labelControl4.Location = new System.Drawing.Point(475, 36); this.labelControl4.Name = "labelControl4"; this.labelControl4.Size = new System.Drawing.Size(52, 14); this.labelControl4.TabIndex = 17; this.labelControl4.Text = "Barcode :"; // // labelControl3 // this.labelControl3.Appearance.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.labelControl3.Location = new System.Drawing.Point(13, 40); this.labelControl3.Name = "labelControl3"; this.labelControl3.Size = new System.Drawing.Size(68, 14); this.labelControl3.TabIndex = 16; this.labelControl3.Text = "Item name :"; // // labelControl2 // this.labelControl2.Appearance.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.labelControl2.Location = new System.Drawing.Point(239, 8); this.labelControl2.Name = "labelControl2"; this.labelControl2.Size = new System.Drawing.Size(53, 14); this.labelControl2.TabIndex = 3; this.labelControl2.Text = "To Date :"; // // dateEdit2 // this.dateEdit2.EditValue = null; this.dateEdit2.Location = new System.Drawing.Point(298, 5); this.dateEdit2.Name = "dateEdit2"; this.dateEdit2.Properties.Appearance.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.dateEdit2.Properties.Appearance.Options.UseFont = true; this.dateEdit2.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}); this.dateEdit2.Properties.VistaTimeProperties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton()}); this.dateEdit2.Size = new System.Drawing.Size(104, 20); this.dateEdit2.TabIndex = 3; // // labelControl1 // this.labelControl1.Appearance.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.labelControl1.Location = new System.Drawing.Point(13, 8); this.labelControl1.Name = "labelControl1"; this.labelControl1.Size = new System.Drawing.Size(65, 14); this.labelControl1.TabIndex = 1; this.labelControl1.Text = "From Date :"; // // dateEdit1 // this.dateEdit1.EditValue = null; this.dateEdit1.Location = new System.Drawing.Point(84, 5); this.dateEdit1.Name = "dateEdit1"; this.dateEdit1.Properties.Appearance.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.dateEdit1.Properties.Appearance.Options.UseFont = true; this.dateEdit1.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}); this.dateEdit1.Properties.VistaTimeProperties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton()}); this.dateEdit1.Size = new System.Drawing.Size(104, 20); this.dateEdit1.TabIndex = 2; // // panel2 // this.panel2.Controls.Add(this.gridControl1); this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom; this.panel2.Location = new System.Drawing.Point(0, 276); this.panel2.Name = "panel2"; this.panel2.Size = new System.Drawing.Size(793, 173); this.panel2.TabIndex = 3; // // gridControl1 // this.gridControl1.DataSource = this.salesByItemBindingSource; this.gridControl1.Dock = System.Windows.Forms.DockStyle.Fill; this.gridControl1.Location = new System.Drawing.Point(0, 0); this.gridControl1.MainView = this.gridView1; this.gridControl1.Name = "gridControl1"; this.gridControl1.Size = new System.Drawing.Size(793, 173); this.gridControl1.TabIndex = 0; this.gridControl1.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { this.gridView1}); // // gridView1 // this.gridView1.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { this.colItemname, this.colValue}); this.gridView1.GridControl = this.gridControl1; this.gridView1.Name = "gridView1"; this.gridView1.OptionsBehavior.AllowDeleteRows = DevExpress.Utils.DefaultBoolean.True; this.gridView1.OptionsCustomization.AllowFilter = false; this.gridView1.OptionsView.ShowGroupPanel = false; // // colItemname // this.colItemname.AppearanceCell.Options.UseTextOptions = true; this.colItemname.AppearanceCell.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Center; this.colItemname.AppearanceHeader.Options.UseTextOptions = true; this.colItemname.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; this.colItemname.AppearanceHeader.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Center; this.colItemname.Caption = "Item name"; this.colItemname.FieldName = "Itemname"; this.colItemname.Name = "colItemname"; this.colItemname.Visible = true; this.colItemname.VisibleIndex = 0; this.colItemname.Width = 210; // // colValue // this.colValue.AppearanceCell.Options.UseTextOptions = true; this.colValue.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; this.colValue.AppearanceCell.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Center; this.colValue.AppearanceHeader.Options.UseTextOptions = true; this.colValue.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; this.colValue.AppearanceHeader.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Center; this.colValue.Caption = "Quantity"; this.colValue.FieldName = "Value"; this.colValue.Name = "colValue"; this.colValue.OptionsColumn.AllowEdit = false; this.colValue.OptionsColumn.ReadOnly = true; this.colValue.Visible = true; this.colValue.VisibleIndex = 1; this.colValue.Width = 87; // // panel3 // this.panel3.Controls.Add(this.chartControl1); this.panel3.Dock = System.Windows.Forms.DockStyle.Fill; this.panel3.Location = new System.Drawing.Point(0, 64); this.panel3.Name = "panel3"; this.panel3.Size = new System.Drawing.Size(793, 212); this.panel3.TabIndex = 4; this.panel3.Paint += new System.Windows.Forms.PaintEventHandler(this.panel3_Paint); // // chartControl1 // this.chartControl1.DataSource = this.salesByItemBindingSource; xyDiagram1.AxisX.GridSpacing = 0.5D; xyDiagram1.AxisX.GridSpacingAuto = false; xyDiagram1.AxisX.Range.ScrollingRange.SideMarginsEnabled = true; xyDiagram1.AxisX.Range.SideMarginsEnabled = true; xyDiagram1.AxisX.Reverse = true; xyDiagram1.AxisX.VisibleInPanesSerializable = "-1"; xyDiagram1.AxisY.Range.ScrollingRange.SideMarginsEnabled = true; xyDiagram1.AxisY.Range.SideMarginsEnabled = true; xyDiagram1.AxisY.VisibleInPanesSerializable = "-1"; this.chartControl1.Diagram = xyDiagram1; this.chartControl1.Dock = System.Windows.Forms.DockStyle.Fill; this.chartControl1.FillStyle.FillMode = DevExpress.XtraCharts.FillMode.Gradient; rectangleGradientFillOptions1.Color2 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255))))); rectangleGradientFillOptions1.GradientMode = DevExpress.XtraCharts.RectangleGradientMode.TopRightToBottomLeft; this.chartControl1.FillStyle.Options = rectangleGradientFillOptions1; this.chartControl1.Location = new System.Drawing.Point(0, 0); this.chartControl1.Name = "chartControl1"; this.chartControl1.SeriesDataMember = "Itemname"; this.chartControl1.SeriesSerializable = new DevExpress.XtraCharts.Series[0]; this.chartControl1.SeriesTemplate.ArgumentDataMember = "Itemname"; sideBySideBarSeriesLabel1.LineVisible = true; this.chartControl1.SeriesTemplate.Label = sideBySideBarSeriesLabel1; this.chartControl1.SeriesTemplate.LabelsVisibility = DevExpress.Utils.DefaultBoolean.True; this.chartControl1.SeriesTemplate.ValueDataMembersSerializable = "Value"; this.chartControl1.Size = new System.Drawing.Size(793, 212); this.chartControl1.TabIndex = 0; // // SalesItemComparsion // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(793, 449); this.Controls.Add(this.panel3); this.Controls.Add(this.panel2); this.Controls.Add(this.panel1); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Name = "SalesItemComparsion"; this.Text = "Sales Item Comparsion"; this.Load += new System.EventHandler(this.SalesItemComparsion_Load); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.SalesItemComparsion_KeyDown); ((System.ComponentModel.ISupportInitialize)(this.salesByItemBindingSource)).EndInit(); this.panel1.ResumeLayout(false); this.panel1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.textEdit1.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.textEdit2.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.dateEdit2.Properties.VistaTimeProperties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.dateEdit2.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.dateEdit1.Properties.VistaTimeProperties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.dateEdit1.Properties)).EndInit(); this.panel2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.gridControl1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.gridView1)).EndInit(); this.panel3.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(xyDiagram1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(sideBySideBarSeriesLabel1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.chartControl1)).EndInit(); this.ResumeLayout(false); }
private void CreateChart(DevExpress.XtraCharts.ChartControl Chart, DataTable dt, string col) { try { Chart.Series.Clear(); Chart.Titles.Clear(); string name = ""; switch (col) { case "UPC": name = "Cutting"; break; case "UPS1": name = "Stitching 1"; break; case "UPS2": name = "Stitching 2"; break; case "FSS": name = "Stockfit"; break; case "FGA": name = "Assembly"; break; } Chart.AppearanceNameSerializable = "Chameleon"; //chartBTS.AppearanceNameSerializable = "Chameleon"; Series series1 = new Series(name, ViewType.Bar); Chart.AnimationStartMode = DevExpress.XtraCharts.ChartAnimationMode.OnDataChanged; DevExpress.XtraCharts.SideBySideBarSeriesView sideBySideBarSeriesView1 = new DevExpress.XtraCharts.SideBySideBarSeriesView(); DevExpress.XtraCharts.RectangleGradientFillOptions rectangleGradientFillOptions1 = new DevExpress.XtraCharts.RectangleGradientFillOptions(); Series series2 = new Series("Target", ViewType.Line); DevExpress.XtraCharts.LineSeriesView lineSeriesView1 = new DevExpress.XtraCharts.LineSeriesView(); lineSeriesView1.MarkerVisibility = DevExpress.Utils.DefaultBoolean.True; //sideBySideBarSeriesView1.ColorEach = true; sideBySideBarSeriesView1.FillStyle.FillMode = DevExpress.XtraCharts.FillMode.Solid; //switch (col) //{ //case "UPC": // sideBySideBarSeriesView1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(112)))), ((int)(((byte)(192))))); // break; //case "UPS1": // sideBySideBarSeriesView1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(49)))), ((int)(((byte)(133)))), ((int)(((byte)(155))))); // break; //case "UPS2": // sideBySideBarSeriesView1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(176)))), ((int)(((byte)(240))))); // break; //case "FSS": // sideBySideBarSeriesView1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(247)))), ((int)(((byte)(150)))), ((int)(((byte)(70))))); // break; //case "FGA": // sideBySideBarSeriesView1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(146)))), ((int)(((byte)(208)))), ((int)(((byte)(80))))); // break; //} sideBySideBarSeriesView1.Color = System.Drawing.Color.ForestGreen; series1.View = sideBySideBarSeriesView1; series1.Label.Font = new System.Drawing.Font("Tahoma", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); series1.Label.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); series1.View = sideBySideBarSeriesView1; series1.Label.TextPattern = "{V:#,#}"; series1.LabelsVisibility = DevExpress.Utils.DefaultBoolean.True; //series2.Label.Font = new System.Drawing.Font("Tahoma", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); //series2.LabelsVisibility = DevExpress.Utils.DefaultBoolean.True; //series2.Label.TextPattern = "{V:#,#}"; lineSeriesView1.Color = System.Drawing.Color.LimeGreen; lineSeriesView1.LineMarkerOptions.Color = System.Drawing.Color.FromArgb(((int)(((byte)(146)))), ((int)(((byte)(208)))), ((int)(((byte)(80))))); lineSeriesView1.LineStyle.Thickness = 3; series2.View = lineSeriesView1; string [] value = null; if (dt != null && dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { value = dt.Rows[i][col].ToString().Split('/'); series1.Points.Add(new SeriesPoint(dt.Rows[i]["DAY"].ToString(), value[0])); if (Convert.ToDouble(value[1]) > 0) { series2.Points.Add(new SeriesPoint(dt.Rows[i]["DAY"].ToString(), value[1])); } else { series2.Points.Add(new SeriesPoint(dt.Rows[i]["DAY"].ToString())); } if (Convert.ToDouble(value[0]) < Convert.ToDouble(value[1])) { series1.Points[i].Color = Color.Red; } else { //switch (col) //{ // case "UPC": // series1.Points[i].Color = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(112)))), ((int)(((byte)(192))))); // break; // case "UPS1": // series1.Points[i].Color = System.Drawing.Color.FromArgb(((int)(((byte)(49)))), ((int)(((byte)(133)))), ((int)(((byte)(155))))); // break; // case "UPS2": // series1.Points[i].Color = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(176)))), ((int)(((byte)(240))))); // break; // case "FSS": // series1.Points[i].Color = System.Drawing.Color.FromArgb(((int)(((byte)(247)))), ((int)(((byte)(150)))), ((int)(((byte)(70))))); // break; // case "FGA": // series1.Points[i].Color = System.Drawing.Color.FromArgb(((int)(((byte)(146)))), ((int)(((byte)(208)))), ((int)(((byte)(80))))); // break; //} series1.Points[i].Color = System.Drawing.Color.ForestGreen; } } Chart.SeriesSerializable = new DevExpress.XtraCharts.Series[] { series1, series2 }; Chart.Legend.Visibility = DevExpress.Utils.DefaultBoolean.True; ((XYDiagram)Chart.Diagram).AxisX.Label.Font = new System.Drawing.Font("Calibri", 14F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); ((XYDiagram)Chart.Diagram).AxisX.Title.Font = new System.Drawing.Font("Calibri", 16F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); ((XYDiagram)Chart.Diagram).AxisY.Label.TextPattern = "{V:#,#}"; ((XYDiagram)Chart.Diagram).AxisY.Label.Font = new System.Drawing.Font("Tahoma", 14F); ((XYDiagram)Chart.Diagram).AxisY.Title.Font = new System.Drawing.Font("Calibri", 16F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); ((XYDiagram)Chart.Diagram).AxisY.Title.Text = "Production (Prs)"; } } catch (Exception EX) { } }