public void AddDelimiter(int x) { var delimiter = new StripLine { Interval = 0, IntervalOffset = x, StripWidth = 0, BorderWidth = 1, BorderColor = Color.Black, }; _chartArea.AxisX.StripLines.Add(delimiter); }
/// <summary> /// Mouse Down Event /// </summary> private void Chart1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { // Call Hit Test Method HitTestResult result = Chart1.HitTest( e.X, e.Y ); if( result.ChartElementType == ChartElementType.AxisLabels && result.Axis == Chart1.ChartAreas["Default"].AxisY ) { StripLine stripLine = new StripLine(); stripLine.IntervalOffset = ((CustomLabel) result.Object).FromPosition; stripLine.Interval = 200; stripLine.BackColor = Color.FromArgb(128, 255,255, 255); stripLine.StripWidth = ((CustomLabel) result.Object).ToPosition - ((CustomLabel) result.Object).FromPosition; Chart1.ChartAreas["Default"].AxisY.StripLines.Add( stripLine ); } }
private void ChartInitialize() { chart1.Series["Average"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.StackedColumn; chart1.Series["Peak"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.StackedColumn; chart1.ChartAreas[0].AxisX.Minimum = 10; chart1.ChartAreas[0].AxisX.Maximum = 27; chart1.ChartAreas[0].AxisY.Minimum = 0; chart1.ChartAreas[0].AxisY.Maximum = 90; chart1.ChartAreas[0].AxisX.Interval = 1; chart1.ChartAreas[0].AxisY.Interval = 10; chart1.ChartAreas[0].AxisX.Title = "Channel"; chart1.ChartAreas[0].AxisY.Title = "dBm"; chart1.ChartAreas[0].AxisX.MajorGrid.Enabled = false; chart1.ChartAreas[0].AxisY.MajorGrid.LineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Dash; chart1.ChartAreas[0].AxisY.MajorGrid.LineColor = Color.Gray; chart1.ChartAreas[0].BorderDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Solid; chart1.ChartAreas[0].BorderColor = Color.Black; chart1.Legends[0].TableStyle = System.Windows.Forms.DataVisualization.Charting.LegendTableStyle.Wide; chart1.Legends[0].LegendItemOrder = System.Windows.Forms.DataVisualization.Charting.LegendItemOrder.ReversedSeriesOrder; StripLine sline = new System.Windows.Forms.DataVisualization.Charting.StripLine(); sline.Interval = 80; sline.Text = "Danger Zone"; sline.TextAlignment = StringAlignment.Center; sline.BorderDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Dash; sline.BorderColor = Color.Red; sline.ForeColor = Color.Red; sline.ToolTip = "TBD Help"; sline.BorderWidth = 2; chart1.ChartAreas[0].AxisY.StripLines.Add(sline); ann.Text = "Scanning..."; ann.Font = new Font(ann.Font.FontFamily.Name, 24); ann.ForeColor = Color.DarkRed; ann.X = 40; ann.Y = 22; ann.Visible = false; chart1.Annotations.Add(ann); /******** Singleton proba * SingleGlobal singleton = SingleGlobal.Instance; * string vvv = singleton.GetGlobal(); * /*************************/ }
private void button4_Click(object sender, EventArgs e) { if (isFirstTab && (scanListView.SelectedIndices.Count != 0)) { ClearGraph(); var sel = scanListView.SelectedIndices[0]; var logLst = scanItems[sel].LogCont; if (logLst.Count == 0) { MessageBox.Show(Strings.LogEmpty, Strings.Attention, MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } graphFrm.Text = string.Format(Strings.GraphFor, scanItems[sel].Steam.scanInput.Name); for (int i = 0; i < logLst.Count; i++) { if (logLst[i].AddCurr) graphFrm.chart1.Series[0].Points.AddXY(logLst[i].Time, logLst[i].RawPrice); } graphFrm.chart1.ChartAreas[0].RecalculateAxesScale(); int wished = Convert.ToInt32(SteamSite.GetSweetPrice(scanItems[sel].Steam.scanInput.Price)); if (graphFrm.chart1.ChartAreas[0].AxisY.Maximum > wished) { StripLine stripOut = new StripLine(); stripOut.IntervalOffset = wished; stripOut.StripWidth = graphFrm.chart1.ChartAreas[0].AxisY.Maximum - wished; stripOut.BackColor = Color.FromArgb(64, Color.Red); graphFrm.chart1.ChartAreas[0].AxisY.StripLines.Add(stripOut); } else { graphFrm.chart1.ChartAreas[0].AxisY.Maximum = wished; } StripLine stripWished = new StripLine(); stripWished.IntervalOffset = 0; stripWished.StripWidth = wished; stripWished.BackColor = Color.FromArgb(64, Color.Green); graphFrm.chart1.ChartAreas[0].AxisY.StripLines.Add(stripWished); graphFrm.Show(); } }
/// <summary> /// Adds a graph highlight to all graphs. /// </summary> /// <param name="time">The time to display the highlight.</param> public void AddGraphHighlight(uint time) { StripLine highlightToBeAdded = new StripLine(); for (int i = 0; i < this.controller.SensorController.SelectedSensors.Length; ++i) { // A new StripLine is required for each graph; reusing the same StripLine eventually leads to display problems highlightToBeAdded = new StripLine(); highlightToBeAdded.BackColor = Color.Yellow; highlightToBeAdded.IntervalOffset = time; highlightToBeAdded.StripWidth = 1000; this.AddGraphHighlightAuxilliary(i, highlightToBeAdded); } }
public static void Chart_Curve(Chart ChartName, string TitleName, string XAxisName, string YAxisName, string SelectMode, string[] XAxisData, double[] YAxisData, double XAxisLabAgle, double MaxValue, double MinValue, bool IsDisplayLine) { Frm_RunInfo FrmRunInfo = new Frm_RunInfo(); long i = 0; long Temp = 0; DataTable dt = new DataTable(); dt.Columns.Add("X轴"); dt.Columns.Add("Y轴"); DataRow dr = default(DataRow); if (ChartName.Name == "Chart_HOUSING") { if (IniGetNValue(PVar.UIChartCurveName, "CurveData", "TotalNum", 0) == 49) { Temp = 49; } else { Temp = (long)(IniGetNValue(PVar.UIChartCurveName, "CurveData", "CurrentNum", 0)); } if (Temp > 0) { for (i = 0; i <= Temp; i++) { dr = dt.NewRow(); dr[0] = (i + 1).ToString(); //X轴 dr[1] = YAxisData[i]; //Y轴 dt.Rows.Add(dr); } dr = null; } } else { if (ChartName.Name == "Chart_YieldOverview") { Temp = FrmRunInfo.TrackBar_yeild.Value; } if (ChartName.Name == "Chart_Tossing") { Temp = FrmRunInfo.TrackBar_tossing.Value; } if (ChartName.Name == "Chart_UPH") { Temp = FrmRunInfo.TrackBar_uph.Value; } for (i = 0; i <= Temp - 1; i++) { dr = dt.NewRow(); dr[0] = XAxisData[i]; //X轴 dr[1] = YAxisData[i]; //Y轴 dt.Rows.Add(dr); } dr = null; } Chart with_1 = ChartName; ChartName.DataSource = dt; //dt作为chart的数据源 ChartName.Series.Clear(); ChartName.Legends.Clear(); ChartName.ChartAreas.Clear(); ChartName.Titles.Clear(); ChartName.Titles.Add(TitleName); ChartName.ChartAreas.Add("Y轴"); ChartName.Series.Add("Y轴"); ChartName.Series.Add("X轴"); ChartName.Series["Y轴"].LegendToolTip = "Y轴图例"; ChartName.ChartAreas["Y轴"].AxisX.Title = XAxisName; //添加AxisX Titles ChartName.ChartAreas["Y轴"].AxisY.Title = YAxisName; //添加AxisY Titles if (ChartName.Name != "Chart_HOUSING") { ChartName.Series["Y轴"].IsValueShownAsLabel = true; //标签显示数据值 } ChartName.ChartAreas["Y轴"].Area3DStyle.Enable3D = false; //启用3D样式 ChartName.BackSecondaryColor = System.Drawing.Color.Yellow; //设置背景的辅助颜色 ChartName.BorderlineColor = System.Drawing.Color.Yellow; //设置图像边框的颜色 ChartName.BorderlineWidth = 1; //设置图像的边框宽度 ChartName.ChartAreas["Y轴"].AxisX.LineColor = System.Drawing.Color.LightGray; //设置轴的线条颜色 ChartName.ChartAreas["Y轴"].AxisY.LineColor = System.Drawing.Color.LightGray; //设置轴的线条颜色 ChartName.ChartAreas["Y轴"].AxisX.MajorGrid.LineColor = System.Drawing.Color.LightGray; //设置网格线颜色 ChartName.ChartAreas["Y轴"].AxisY.MajorGrid.LineColor = System.Drawing.Color.LightGray; //设置网格线颜色 ChartName.ChartAreas["Y轴"].AxisY.IsLabelAutoFit = true; //设置是否自动调整轴标签 ChartName.ChartAreas["Y轴"].BackColor = Color.FromArgb(255, 255, 255); ChartName.BackColor = Color.FromArgb(238, 238, 238); if (ChartName.Name == "Chart_HOUSING") { ChartName.ChartAreas["Y轴"].AxisX.MajorGrid.Interval = 1; //设置X轴间隔距离 ChartName.ChartAreas["Y轴"].AxisY.IsStartedFromZero = false; //设置是否自动将数据值均为正值时轴的最小值设置为0,存在负数据值时,将使用数据轴最小值 } else { ChartName.ChartAreas["Y轴"].AxisX.MajorGrid.Interval = 1; //设置X轴间隔距离 } ChartName.ChartAreas["Y轴"].AxisX.MajorTickMark.IntervalType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Number; ////设置刻度线的间隔的度量单位 ChartName.ChartAreas["Y轴"].AxisY.MajorTickMark.IntervalType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Number; ////设置刻度线的间隔的度量单位 ChartName.ChartAreas["Y轴"].AxisY.MajorGrid.LineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Dash; ChartName.ChartAreas["Y轴"].AxisX.MajorGrid.LineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Dash; ChartName.ChartAreas["Y轴"].AxisX.MajorTickMark.Interval = 1; if (ChartName.Name == "Chart_HOUSING") { ChartName.ChartAreas["Y轴"].AxisY.MajorTickMark.Interval = 0.01; //设置刻度线的间隔 ChartName.ChartAreas["Y轴"].AxisY.Maximum = double.Parse(Strings.Format(MaxValue, "0.00")) + 0.1; ChartName.ChartAreas["Y轴"].AxisY.Minimum = double.Parse(Strings.Format(MinValue, "0.00")) - 0.1; } else { ChartName.ChartAreas["Y轴"].AxisY.MajorTickMark.Interval = 1; //设置刻度线的间隔 } ChartName.ChartAreas["Y轴"].AxisX.LabelStyle.Angle = (int)XAxisLabAgle; //X轴标题倾斜角度 ChartName.Series[0].YValueMembers = "Y轴"; ChartName.Series[0].XValueMember = "X轴"; if (ChartName.Name == "Chart_HOUSING") { ChartName.Series[0].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; } else if (ChartName.Name == "Chart_UPH") { ChartName.Series[0].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Column; } else { ChartName.Series[0].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; } ChartName.Series[0].Color = Color.Blue; if (ChartName.Name != "Chart_UPH") { ChartName.Series[1].YValueMembers = "Y轴"; ChartName.Series[1].XValueMember = "X轴"; ChartName.Series[1].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; ChartName.Series[1].Color = Color.Gold; } if (IsDisplayLine) { System.Windows.Forms.DataVisualization.Charting.StripLine S1 = default(System.Windows.Forms.DataVisualization.Charting.StripLine); System.Windows.Forms.DataVisualization.Charting.StripLine S2 = default(System.Windows.Forms.DataVisualization.Charting.StripLine); System.Windows.Forms.DataVisualization.Charting.StripLine S3 = new System.Windows.Forms.DataVisualization.Charting.StripLine(); S1.BorderColor = Color.Red; S1.IntervalOffset = double.Parse(Strings.Format(MinValue, "0.00")); S2.BorderColor = Color.Red; S2.IntervalOffset = double.Parse(Strings.Format(MaxValue, "0.00")); S3.BorderColor = Color.Green; S3.IntervalOffset = double.Parse(Strings.Format((MaxValue + MinValue) / 2, "0.00")); ChartName.ChartAreas["Y轴"].AxisY.StripLines.Add(S1); ChartName.ChartAreas["Y轴"].AxisY.StripLines.Add(S2); ChartName.ChartAreas["Y轴"].AxisY.StripLines.Add(S3); } ChartName.DataBind(); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); System.Windows.Forms.DataVisualization.Charting.StripLine stripLine1 = new System.Windows.Forms.DataVisualization.Charting.StripLine(); System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend(); System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series(); System.Windows.Forms.DataVisualization.Charting.Title title1 = new System.Windows.Forms.DataVisualization.Charting.Title(); this.label9 = new System.Windows.Forms.Label(); this.panel1 = new System.Windows.Forms.Panel(); this.label6 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.label15 = new System.Windows.Forms.Label(); this.Chart1 = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.label1 = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.Chart1)).BeginInit(); this.SuspendLayout(); // // label9 // this.label9.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.label9.Font = new System.Drawing.Font("Verdana", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label9.Location = new System.Drawing.Point(16, 8); this.label9.Name = "label9"; this.label9.Size = new System.Drawing.Size(702, 34); this.label9.TabIndex = 0; this.label9.Text = "This sample demonstrates how to use the GetToolTipText event to retrieve or modif" + "y tooltip text."; this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // panel1 // this.panel1.Controls.Add(this.label6); this.panel1.Controls.Add(this.label5); this.panel1.Controls.Add(this.label4); this.panel1.Controls.Add(this.label3); this.panel1.Controls.Add(this.label15); this.panel1.Location = new System.Drawing.Point(432, 68); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(292, 288); this.panel1.TabIndex = 19; // // label6 // this.label6.Location = new System.Drawing.Point(64, 403); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(100, 23); this.label6.TabIndex = 5; this.label6.Text = "Border Size:"; // // label5 // this.label5.Location = new System.Drawing.Point(64, 380); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(100, 23); this.label5.TabIndex = 4; this.label5.Text = "Border Color:"; // // label4 // this.label4.Location = new System.Drawing.Point(64, 357); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(100, 23); this.label4.TabIndex = 3; this.label4.Text = "Hatch Style:"; // // label3 // this.label3.Location = new System.Drawing.Point(64, 334); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(100, 23); this.label3.TabIndex = 2; this.label3.Text = "Gradient:"; // // label15 // this.label15.Location = new System.Drawing.Point(64, 426); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(100, 23); this.label15.TabIndex = 5; this.label15.Text = "Border Size:"; // // Chart1 // this.Chart1.BackColor = System.Drawing.Color.WhiteSmoke; this.Chart1.BackGradientStyle = System.Windows.Forms.DataVisualization.Charting.GradientStyle.TopBottom; this.Chart1.BackSecondaryColor = System.Drawing.Color.White; this.Chart1.BorderlineColor = System.Drawing.Color.FromArgb(((int)(((byte)(26)))), ((int)(((byte)(59)))), ((int)(((byte)(105))))); this.Chart1.BorderlineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Solid; this.Chart1.BorderlineWidth = 2; this.Chart1.BorderSkin.SkinStyle = System.Windows.Forms.DataVisualization.Charting.BorderSkinStyle.Emboss; chartArea1.Area3DStyle.Inclination = 15; chartArea1.Area3DStyle.IsClustered = true; chartArea1.Area3DStyle.IsRightAngleAxes = false; chartArea1.Area3DStyle.Perspective = 10; chartArea1.Area3DStyle.Rotation = 10; chartArea1.Area3DStyle.WallWidth = 0; chartArea1.AxisX.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); chartArea1.AxisX.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisX.MajorGrid.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisX.ScaleView.Position = 3; chartArea1.AxisX.ScaleView.Size = 30; chartArea1.AxisX.ScrollBar.ButtonColor = System.Drawing.Color.LightGray; chartArea1.AxisX.ScrollBar.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); stripLine1.Interval = 20; stripLine1.StripWidth = 5; chartArea1.AxisX.StripLines.Add(stripLine1); chartArea1.AxisX2.Enabled = System.Windows.Forms.DataVisualization.Charting.AxisEnabled.False; chartArea1.AxisY.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); chartArea1.AxisY.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisY.MajorGrid.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisY.ScaleView.Position = 5; chartArea1.AxisY.ScaleView.Size = 10; chartArea1.AxisY.ScrollBar.ButtonColor = System.Drawing.Color.LightGray; chartArea1.AxisY.ScrollBar.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisY2.Enabled = System.Windows.Forms.DataVisualization.Charting.AxisEnabled.False; chartArea1.BackColor = System.Drawing.Color.Gainsboro; chartArea1.BackGradientStyle = System.Windows.Forms.DataVisualization.Charting.GradientStyle.TopBottom; chartArea1.BackSecondaryColor = System.Drawing.Color.White; chartArea1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.CursorX.IsUserEnabled = true; chartArea1.CursorX.IsUserSelectionEnabled = true; chartArea1.CursorY.IsUserEnabled = true; chartArea1.CursorY.IsUserSelectionEnabled = true; chartArea1.Name = "Default"; chartArea1.ShadowColor = System.Drawing.Color.Transparent; this.Chart1.ChartAreas.Add(chartArea1); legend1.BackColor = System.Drawing.Color.Transparent; legend1.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); legend1.IsTextAutoFit = false; legend1.Name = "Default"; this.Chart1.Legends.Add(legend1); this.Chart1.Location = new System.Drawing.Point(16, 48); this.Chart1.Name = "Chart1"; series1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(180)))), ((int)(((byte)(26)))), ((int)(((byte)(59)))), ((int)(((byte)(105))))); series1.ChartArea = "Default"; series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; series1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(64)))), ((int)(((byte)(10))))); series1.Legend = "Default"; series1.MarkerSize = 8; series1.MarkerStyle = System.Windows.Forms.DataVisualization.Charting.MarkerStyle.Circle; series1.Name = "Series1"; series1.ShadowOffset = 2; this.Chart1.Series.Add(series1); this.Chart1.Size = new System.Drawing.Size(412, 296); this.Chart1.TabIndex = 0; title1.Font = new System.Drawing.Font("Trebuchet MS", 14.25F, System.Drawing.FontStyle.Bold); title1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(26)))), ((int)(((byte)(59)))), ((int)(((byte)(105))))); title1.Name = "Title1"; title1.ShadowColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); title1.ShadowOffset = 3; title1.Text = "Custom ToolTips"; this.Chart1.Titles.Add(title1); this.Chart1.GetToolTipText += new System.EventHandler<System.Windows.Forms.DataVisualization.Charting.ToolTipEventArgs>(this.Chart1_GetToolTipText); // // label1 // this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.label1.Font = new System.Drawing.Font("Verdana", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label1.Location = new System.Drawing.Point(16, 352); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(708, 36); this.label1.TabIndex = 20; this.label1.Text = "Move the mouse cursor over the chart elements to see different tooltip text."; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // CustomToolTips // this.Controls.Add(this.label1); this.Controls.Add(this.Chart1); this.Controls.Add(this.panel1); this.Controls.Add(this.label9); this.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Name = "CustomToolTips"; this.Size = new System.Drawing.Size(728, 480); this.Load += new System.EventHandler(this.CustomToolTips_Load); this.panel1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.Chart1)).EndInit(); this.ResumeLayout(false); }
private void LoadData() { double dStartDate = DateTime.Today.ToOADate(); chart1.ChartAreas["Default"].AxisY.Minimum = dStartDate-1; chart1.ChartAreas["Default"].AxisY.LabelStyle.Interval = 3; chart1.ChartAreas["Default"].AxisY.LabelStyle.IntervalType = DateTimeIntervalType.Days; string [] task = { "Task 1", "Task 2", "Task 2", "Task 3", "Task 4", "Task 5", "Task 5", "Task 6", "Task 7" }; double [] start = {3, 1, 6, 0, 3, 2, 5.5, 2, 4 }; double [] end = {5, 3.5, 8, 5.5, 4, 3.5, 8, 5, 5 }; Series ser = chart1.Series[0]; int pos = 1; string lastValue = ""; for(int i = 0; i < start.Length-1; i++) { string xValue = task[i]; if(lastValue != xValue) pos++; string yValues = (dStartDate+start[i]).ToString()+","+(dStartDate+end[i]).ToString(); DataPoint pt = new DataPoint(pos, yValues); pt.AxisLabel = xValue; ser.Points.Add(pt); lastValue = xValue; } double [] actualStart = {3, 1, 6, 0, 3, 2, 5.5, 2, 4 }; double [] actualEnd = {4.5, 4.5, 6, 4.5, 4, 3.5, 5.5, 4.5, 4.5 }; ser = chart1.Series[1]; pos = 1; lastValue = ""; for(int i = 0; i < start.Length-1; i++) { string xValue = task[i]; if(lastValue != xValue) pos++; string yValues = (dStartDate+actualStart[i]).ToString()+","+(dStartDate+actualEnd[i]).ToString(); DataPoint pt = new DataPoint(pos, yValues); pt.AxisLabel = xValue; ser.Points.Add(pt); if(dStartDate+dToday > actualStart[i]) { if(start[i] < actualStart[i] || end[i] < actualEnd[i]) pt.Color = Color.Red; else if(dStartDate+dToday < end[i]) pt.Color = Color.Lime; else if(end[i] == actualEnd[i]) pt.Color = Color.Gray; } lastValue = xValue; } StripLine stripLine = new StripLine(); stripLine.StripWidth = 1; stripLine.Font = new Font("Arial", 8.25F, FontStyle.Bold); stripLine.Text = "Today"; stripLine.TextOrientation = TextOrientation.Rotated90; stripLine.BorderColor = Color.Black; stripLine.BackColor = Color.PaleTurquoise; stripLine.IntervalOffset = dStartDate+dToday; stripLine.TextAlignment = StringAlignment.Center; stripLine.TextLineAlignment = StringAlignment.Near; chart1.ChartAreas[0].AxisY.StripLines.Add(stripLine); foreach(DataPoint pt in chart1.Series["Actual"].Points) { if(pt.YValues[0] == pt.YValues[1]) pt.Color = Color.Transparent; } }
private void LegendCustomItems_Load(object sender, System.EventArgs e) { // Disable legend item for the first series Chart1.Series[0].IsVisibleInLegend = false; // Add simple custom legend item Chart1.Legends["Default"].CustomItems.Add(Color.FromArgb(32, 120,147,190), "Critical Values"); // Add custom legend item with line style LegendItem legendItem = new LegendItem(); legendItem.Name = "Line Style Item"; legendItem.ImageStyle = LegendImageStyle.Line; legendItem.ShadowOffset = 1; legendItem.Color = Color.LightBlue; legendItem.MarkerStyle = MarkerStyle.Circle; Chart1.Legends["Default"].CustomItems.Add(legendItem); // Add custom legend item with marker style legendItem = new LegendItem(); legendItem.Name = "Marker Style Item"; legendItem.ImageStyle = LegendImageStyle.Marker; legendItem.ShadowOffset = 1; legendItem.Color = Color.Yellow; legendItem.MarkerStyle = MarkerStyle.Cross; legendItem.MarkerSize = 10; legendItem.MarkerBorderColor = Color.Black; Chart1.Legends["Default"].CustomItems.Add(legendItem); // Add custom legend item with image System.Windows.Forms.DataVisualization.Charting.Utilities.SampleMain.MainForm mainForm = (System.Windows.Forms.DataVisualization.Charting.Utilities.SampleMain.MainForm)this.ParentForm; string imageFileName = mainForm.CurrentSamplePath; imageFileName += "\\Flag.gif"; legendItem = new LegendItem(); legendItem.Name = "Image Style Item"; legendItem.Image = imageFileName; legendItem.BackImageTransparentColor = Color.White; Chart1.Legends["Default"].CustomItems.Add(legendItem); // Add a strip line StripLine stripLine = new StripLine(); stripLine.BackColor = Chart1.Legends["Default"].CustomItems[0].Color; stripLine.IntervalOffset = 500; stripLine.StripWidth = 300; Chart1.ChartAreas["Default"].AxisY.StripLines.Add(stripLine); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); System.Windows.Forms.DataVisualization.Charting.StripLine stripLine1 = new System.Windows.Forms.DataVisualization.Charting.StripLine(); System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend(); System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series(); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint1 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 3); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint2 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 5); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint3 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 4); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint4 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 2); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint5 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 8); System.Windows.Forms.DataVisualization.Charting.Title title1 = new System.Windows.Forms.DataVisualization.Charting.Title(); this.label9 = new System.Windows.Forms.Label(); this.panel1 = new System.Windows.Forms.Panel(); this.label6 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.label15 = new System.Windows.Forms.Label(); this.Chart1 = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.Chart1)).BeginInit(); this.SuspendLayout(); // // label9 // this.label9.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.label9.Font = new System.Drawing.Font("Verdana", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label9.Location = new System.Drawing.Point(16, 14); this.label9.Name = "label9"; this.label9.Size = new System.Drawing.Size(702, 43); this.label9.TabIndex = 0; this.label9.Text = "This sample demonstrates how to use selection to explode a pie slice. To explode " + "a slice, click on the slice or a legend item. "; this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // panel1 // this.panel1.Controls.Add(this.label6); this.panel1.Controls.Add(this.label5); this.panel1.Controls.Add(this.label4); this.panel1.Controls.Add(this.label3); this.panel1.Controls.Add(this.label15); this.panel1.Location = new System.Drawing.Point(432, 73); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(292, 288); this.panel1.TabIndex = 19; // // label6 // this.label6.Location = new System.Drawing.Point(64, 403); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(100, 23); this.label6.TabIndex = 5; this.label6.Text = "Border Size:"; // // label5 // this.label5.Location = new System.Drawing.Point(64, 380); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(100, 23); this.label5.TabIndex = 4; this.label5.Text = "Border Color:"; // // label4 // this.label4.Location = new System.Drawing.Point(64, 357); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(100, 23); this.label4.TabIndex = 3; this.label4.Text = "Hatch Style:"; // // label3 // this.label3.Location = new System.Drawing.Point(64, 334); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(100, 23); this.label3.TabIndex = 2; this.label3.Text = "Gradient:"; // // label15 // this.label15.Location = new System.Drawing.Point(64, 426); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(100, 23); this.label15.TabIndex = 5; this.label15.Text = "Border Size:"; // // Chart1 // this.Chart1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(243)))), ((int)(((byte)(223)))), ((int)(((byte)(193))))); this.Chart1.BackGradientStyle = System.Windows.Forms.DataVisualization.Charting.GradientStyle.TopBottom; this.Chart1.BorderlineColor = System.Drawing.Color.FromArgb(((int)(((byte)(181)))), ((int)(((byte)(64)))), ((int)(((byte)(1))))); this.Chart1.BorderlineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Solid; this.Chart1.BorderlineWidth = 2; this.Chart1.BorderSkin.SkinStyle = System.Windows.Forms.DataVisualization.Charting.BorderSkinStyle.Emboss; chartArea1.Area3DStyle.Inclination = 15; chartArea1.Area3DStyle.IsClustered = true; chartArea1.Area3DStyle.IsRightAngleAxes = false; chartArea1.Area3DStyle.Perspective = 10; chartArea1.Area3DStyle.Rotation = 10; chartArea1.Area3DStyle.WallWidth = 0; chartArea1.AxisX.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); chartArea1.AxisX.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisX.MajorGrid.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisX.ScaleView.Position = 3; chartArea1.AxisX.ScaleView.Size = 30; stripLine1.Interval = 20; stripLine1.StripWidth = 5; chartArea1.AxisX.StripLines.Add(stripLine1); chartArea1.AxisX2.Enabled = System.Windows.Forms.DataVisualization.Charting.AxisEnabled.False; chartArea1.AxisY.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); chartArea1.AxisY.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisY.MajorGrid.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisY.ScaleView.Position = 5; chartArea1.AxisY.ScaleView.Size = 10; chartArea1.AxisY2.Enabled = System.Windows.Forms.DataVisualization.Charting.AxisEnabled.False; chartArea1.BackColor = System.Drawing.Color.Transparent; chartArea1.BackSecondaryColor = System.Drawing.Color.White; chartArea1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.BorderWidth = 0; chartArea1.CursorX.IsUserEnabled = true; chartArea1.CursorX.IsUserSelectionEnabled = true; chartArea1.CursorY.IsUserEnabled = true; chartArea1.CursorY.IsUserSelectionEnabled = true; chartArea1.InnerPlotPosition.Auto = false; chartArea1.InnerPlotPosition.Height = 80F; chartArea1.InnerPlotPosition.Width = 80F; chartArea1.InnerPlotPosition.X = 10F; chartArea1.InnerPlotPosition.Y = 10F; chartArea1.Name = "Default"; chartArea1.Position.Auto = false; chartArea1.Position.Height = 84F; chartArea1.Position.Width = 74F; chartArea1.Position.X = 4.824818F; chartArea1.Position.Y = 12F; chartArea1.ShadowColor = System.Drawing.Color.Transparent; this.Chart1.ChartAreas.Add(chartArea1); legend1.BackColor = System.Drawing.Color.Transparent; legend1.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); legend1.IsTextAutoFit = false; legend1.Name = "Default"; this.Chart1.Legends.Add(legend1); this.Chart1.Location = new System.Drawing.Point(16, 65); this.Chart1.Name = "Chart1"; series1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(180)))), ((int)(((byte)(26)))), ((int)(((byte)(59)))), ((int)(((byte)(105))))); series1.ChartArea = "Default"; series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Pie; series1.CustomProperties = "PieLabelStyle=Disabled"; series1.Legend = "Default"; series1.Name = "Series1"; dataPoint1.AxisLabel = "Product A"; dataPoint2.AxisLabel = "Product B"; dataPoint3.AxisLabel = "Product C"; dataPoint4.AxisLabel = "Product D"; dataPoint5.AxisLabel = "Product E"; series1.Points.Add(dataPoint1); series1.Points.Add(dataPoint2); series1.Points.Add(dataPoint3); series1.Points.Add(dataPoint4); series1.Points.Add(dataPoint5); series1.ShadowOffset = 4; this.Chart1.Series.Add(series1); this.Chart1.Size = new System.Drawing.Size(412, 296); this.Chart1.TabIndex = 0; title1.Font = new System.Drawing.Font("Trebuchet MS", 14.25F, System.Drawing.FontStyle.Bold); title1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(26)))), ((int)(((byte)(59)))), ((int)(((byte)(105))))); title1.Name = "Title1"; title1.ShadowColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); title1.ShadowOffset = 3; title1.Text = "Select a Slice of the Pie"; this.Chart1.Titles.Add(title1); this.Chart1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Chart1_MouseMove); this.Chart1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Chart1_MouseDown); this.Chart1.Click += new System.EventHandler(this.Chart1_Click); // // InteractivePie // this.BackColor = System.Drawing.Color.White; this.Controls.Add(this.Chart1); this.Controls.Add(this.panel1); this.Controls.Add(this.label9); this.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Name = "InteractivePie"; this.Size = new System.Drawing.Size(728, 368); this.panel1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.Chart1)).EndInit(); this.ResumeLayout(false); }
private void comboBoxPointsHighlight_SelectedIndexChanged(object sender, System.EventArgs e) { double offset = -1.5; double width = 2; chart1.ChartAreas["Default"].AxisX.StripLines.Clear(); string SelectedText = comboBoxPointsHighlight.SelectedItem.ToString(); if(SelectedText == "Weekends") { offset = -1.5; width = 2; } else if(SelectedText == "Weekdays") { offset = 0.5; width = 5; } else if(SelectedText == "Mondays") { offset = 0.5; width = 1; } else if(SelectedText == "Wednesdays") { offset = 2.5; width = 1; } else if(SelectedText == "Fridays") { offset = 4.5; width = 1; } else if(SelectedText == "Mondays and Fridays") { // Create a re-occurring strip line for the monday StripLine strip = new StripLine(); strip.BackColor = Color.FromArgb(120, Color.Gray); strip.IntervalOffset = 0.5; strip.IntervalOffsetType = DateTimeIntervalType.Days; strip.Interval = 1; strip.IntervalType = DateTimeIntervalType.Weeks; strip.StripWidth = 1; strip.StripWidthType = DateTimeIntervalType.Days; chart1.ChartAreas["Default"].AxisX.StripLines.Add(strip); offset = 4.5; width = 1; } // Create a re-occurring strip line for the selected range or // just the firday if monday and friday is the selection StripLine stripLine = new StripLine(); stripLine.BackColor = Color.FromArgb(120, Color.Gray); stripLine.IntervalOffset = offset; stripLine.IntervalOffsetType = DateTimeIntervalType.Days; stripLine.Interval = 1; stripLine.IntervalType = DateTimeIntervalType.Weeks; stripLine.StripWidth = width; stripLine.StripWidthType = DateTimeIntervalType.Days; chart1.ChartAreas["Default"].AxisX.StripLines.Add(stripLine); }
public void fillData(DataTable dt) { balanceS = dt.Rows[0][1].ToString(); dgvReport.DataSource = dt; chartReport.DataSource = dt; chartReport.Series[0].YValueMembers = "Revenue"; //chartReport.Series[0].ChartType = SeriesChartType.Line; //chartReport.Series["Threshold"].Points.Clear(); chartReport.ChartAreas[0].AxisY.StripLines.Clear(); StripLine stripLineTarget = new StripLine(); stripLineTarget.BorderColor = System.Drawing.Color.Red; switch (ddlPickReport.SelectedIndex) { case 0: chartReport.Series[0].XValueMember = "Day"; //chartReport.Series["Threshold"].Points.AddXY(0, 333); //chartReport.Series["Threshold"].Points.AddXY(chartReport.ChartAreas[0].AxisX.Maximum, 333); //chartReport.ChartAreas[0].AxisX.Minimum = 0; stripLineTarget.IntervalOffset = 333; chartReport.ChartAreas[0].AxisY.Maximum = 700; break; case 1: chartReport.Series[0].XValueMember = "Week #"; //chartReport.Series["Threshold"].Points.AddXY(0, 2500); //chartReport.Series["Threshold"].Points.AddXY(chartReport.ChartAreas[0].AxisX.Maximum, 2500); ///chartReport.ChartAreas[0].AxisX.Minimum = 0; stripLineTarget.IntervalOffset = 2500; chartReport.ChartAreas[0].AxisY.Maximum = 4000; break; case 2: chartReport.Series[0].XValueMember = "Month"; //chartReport.Series["Threshold"].Points.AddXY(0, 10000); ///chartReport.Series["Threshold"].Points.AddXY(chartReport.ChartAreas[0].AxisX.Maximum, 10000); //chartReport.ChartAreas[0].AxisX.Minimum = 0; stripLineTarget.IntervalOffset = 10000; chartReport.ChartAreas[0].AxisY.Maximum = 12000; break; case 3: chartReport.Series[0].XValueMember = "Quarter"; //chartReport.Series["Threshold"].Points.AddXY(0, 30000); //chartReport.Series["Threshold"].Points.AddXY(chartReport.ChartAreas[0].AxisX.Maximum, 30000); //chartReport.ChartAreas[0].AxisX.Minimum = 0; stripLineTarget.IntervalOffset = 30000; chartReport.ChartAreas[0].AxisY.Maximum = 50000; break; case 4: chartReport.Series[0].XValueMember = "Year"; //chartReport.Series["Threshold"].Points.AddXY(2012, 120000); //chartReport.Series["Threshold"].Points.AddXY(2020, 120000); //chartReport.ChartAreas[0].AxisX.Minimum = 2012; //chartReport.ChartAreas[0].AxisX.Maximum = 2020; //chartReport.ChartAreas[0].AxisX.MajorGrid.Interval = 1; stripLineTarget.IntervalOffset = 120000; chartReport.ChartAreas[0].AxisY.Maximum = 150000; break; case 5: chartReport.Series[0].XValueMember = "Year"; break; case 6: chartReport.Series[0].XValueMember = "Year"; break; } chartReport.ChartAreas[0].AxisY.StripLines.Add(stripLineTarget); chartReport.DataBind(); }
private void UpdateChartSettings() { // Create strip lines which cover the areas with filtered values chart1.ChartAreas["Default"].AxisX.StripLines.Clear(); StripLine stripLine = new StripLine(); stripLine.BackColor = Color.FromArgb(120, 241,185,168); stripLine.IntervalOffset = double.Parse(comboBoxOffset.Text); stripLine.Interval = double.Parse(comboBoxWidth.Text) * 2.0; stripLine.StripWidth = double.Parse(comboBoxWidth.Text); chart1.ChartAreas["Default"].AxisX.StripLines.Add(stripLine); // Filter series data using custom filtering criteria chart1.DataManipulator.Filter(new CustomFilter(stripLine.IntervalOffset, stripLine.StripWidth), "Series Input", "Series Output"); // Show data points using point's index if(comboBoxShowAsIndexed.Text == "True") { chart1.Series["Series Output"].IsXValueIndexed = true; chart1.ChartAreas["FilteredData"].AxisX.Minimum = double.NaN; chart1.ChartAreas["FilteredData"].AxisX.Maximum = double.NaN; chart1.ChartAreas["FilteredData"].AxisX.LabelStyle.Interval = 2; chart1.ChartAreas["FilteredData"].AxisX.MajorTickMark.Interval = 2; chart1.ChartAreas["FilteredData"].AxisX.MajorGrid.Interval = 2; } else { chart1.Series["Series Output"].IsXValueIndexed = false; chart1.ChartAreas["FilteredData"].AxisX.Minimum = 0; chart1.ChartAreas["FilteredData"].AxisX.Maximum = 100; chart1.ChartAreas["FilteredData"].AxisX.LabelStyle.Interval = 0; chart1.ChartAreas["FilteredData"].AxisX.MajorTickMark.Interval = 0; chart1.ChartAreas["FilteredData"].AxisX.MajorGrid.Interval = 0; } }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); System.Windows.Forms.DataVisualization.Charting.StripLine stripLine1 = new System.Windows.Forms.DataVisualization.Charting.StripLine(); System.Windows.Forms.DataVisualization.Charting.StripLine stripLine2 = new System.Windows.Forms.DataVisualization.Charting.StripLine(); System.Windows.Forms.DataVisualization.Charting.StripLine stripLine3 = new System.Windows.Forms.DataVisualization.Charting.StripLine(); System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend(); System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series(); this.chart1 = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.labelSampleComment = new System.Windows.Forms.Label(); this.panel1 = new System.Windows.Forms.Panel(); this.label5 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); this.button1 = new System.Windows.Forms.Button(); this.label7 = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.chart1)).BeginInit(); this.panel1.SuspendLayout(); this.SuspendLayout(); // // chart1 // this.chart1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(243)))), ((int)(((byte)(223)))), ((int)(((byte)(193))))); this.chart1.BackGradientStyle = System.Windows.Forms.DataVisualization.Charting.GradientStyle.TopBottom; this.chart1.BorderlineColor = System.Drawing.Color.FromArgb(((int)(((byte)(181)))), ((int)(((byte)(64)))), ((int)(((byte)(1))))); this.chart1.BorderlineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Solid; this.chart1.BorderlineWidth = 2; this.chart1.BorderSkin.SkinStyle = System.Windows.Forms.DataVisualization.Charting.BorderSkinStyle.Emboss; chartArea1.Area3DStyle.Inclination = 15; chartArea1.Area3DStyle.IsClustered = true; chartArea1.Area3DStyle.IsRightAngleAxes = false; chartArea1.Area3DStyle.Perspective = 10; chartArea1.Area3DStyle.Rotation = 10; chartArea1.Area3DStyle.WallWidth = 0; chartArea1.AxisX.LabelAutoFitStyle = ((System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles)((((System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles.DecreaseFont | System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles.StaggeredLabels) | System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles.LabelsAngleStep30) | System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles.WordWrap))); chartArea1.AxisX.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); chartArea1.AxisX.LabelStyle.Interval = 0; chartArea1.AxisX.LabelStyle.IntervalOffset = 0; chartArea1.AxisX.LabelStyle.IntervalOffsetType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Auto; chartArea1.AxisX.LabelStyle.IntervalType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Auto; chartArea1.AxisX.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisX.MajorGrid.Interval = 0; chartArea1.AxisX.MajorGrid.IntervalOffset = 0; chartArea1.AxisX.MajorGrid.IntervalOffsetType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Auto; chartArea1.AxisX.MajorGrid.IntervalType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Auto; chartArea1.AxisX.MajorGrid.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisX.MajorTickMark.Interval = 0; chartArea1.AxisX.MajorTickMark.IntervalOffset = 0; chartArea1.AxisX.MajorTickMark.IntervalOffsetType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Auto; chartArea1.AxisX.MajorTickMark.IntervalType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Auto; chartArea1.AxisX2.LabelAutoFitStyle = ((System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles)((((System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles.DecreaseFont | System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles.StaggeredLabels) | System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles.LabelsAngleStep30) | System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles.WordWrap))); chartArea1.AxisX2.LabelStyle.Interval = 0; chartArea1.AxisX2.LabelStyle.IntervalOffset = 0; chartArea1.AxisX2.LabelStyle.IntervalOffsetType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Auto; chartArea1.AxisX2.LabelStyle.IntervalType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Auto; chartArea1.AxisX2.MajorGrid.Interval = 0; chartArea1.AxisX2.MajorGrid.IntervalOffset = 0; chartArea1.AxisX2.MajorGrid.IntervalOffsetType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Auto; chartArea1.AxisX2.MajorGrid.IntervalType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Auto; chartArea1.AxisX2.MajorTickMark.Interval = 0; chartArea1.AxisX2.MajorTickMark.IntervalOffset = 0; chartArea1.AxisX2.MajorTickMark.IntervalOffsetType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Auto; chartArea1.AxisX2.MajorTickMark.IntervalType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Auto; chartArea1.AxisY.LabelAutoFitStyle = ((System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles)((((System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles.DecreaseFont | System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles.StaggeredLabels) | System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles.LabelsAngleStep30) | System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles.WordWrap))); chartArea1.AxisY.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); chartArea1.AxisY.LabelStyle.Interval = 0; chartArea1.AxisY.LabelStyle.IntervalOffset = 0; chartArea1.AxisY.LabelStyle.IntervalOffsetType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Auto; chartArea1.AxisY.LabelStyle.IntervalType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Auto; chartArea1.AxisY.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisY.MajorGrid.Enabled = false; chartArea1.AxisY.MajorGrid.Interval = 0; chartArea1.AxisY.MajorGrid.IntervalOffset = 0; chartArea1.AxisY.MajorGrid.IntervalOffsetType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Auto; chartArea1.AxisY.MajorGrid.IntervalType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Auto; chartArea1.AxisY.MajorGrid.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisY.MajorTickMark.Interval = 0; chartArea1.AxisY.MajorTickMark.IntervalOffset = 0; chartArea1.AxisY.MajorTickMark.IntervalOffsetType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Auto; chartArea1.AxisY.MajorTickMark.IntervalType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Auto; stripLine1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(241)))), ((int)(((byte)(185)))), ((int)(((byte)(168))))); stripLine1.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); stripLine1.IntervalOffset = 20; stripLine1.StripWidth = 50; stripLine1.Text = "Standard Deviation"; stripLine1.TextLineAlignment = System.Drawing.StringAlignment.Far; stripLine2.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(252)))), ((int)(((byte)(180)))), ((int)(((byte)(65))))); stripLine2.BorderWidth = 2; stripLine2.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); stripLine2.IntervalOffset = 40; stripLine2.Text = "Mean"; stripLine2.TextLineAlignment = System.Drawing.StringAlignment.Far; stripLine3.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(64)))), ((int)(((byte)(10))))); stripLine3.BorderWidth = 2; stripLine3.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); stripLine3.IntervalOffset = 50; stripLine3.Text = "Median"; stripLine3.TextAlignment = System.Drawing.StringAlignment.Near; stripLine3.TextLineAlignment = System.Drawing.StringAlignment.Far; chartArea1.AxisY.StripLines.Add(stripLine1); chartArea1.AxisY.StripLines.Add(stripLine2); chartArea1.AxisY.StripLines.Add(stripLine3); chartArea1.AxisY2.LabelAutoFitStyle = ((System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles)((((System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles.DecreaseFont | System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles.StaggeredLabels) | System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles.LabelsAngleStep30) | System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles.WordWrap))); chartArea1.AxisY2.LabelStyle.Interval = 0; chartArea1.AxisY2.LabelStyle.IntervalOffset = 0; chartArea1.AxisY2.LabelStyle.IntervalOffsetType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Auto; chartArea1.AxisY2.LabelStyle.IntervalType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Auto; chartArea1.AxisY2.MajorGrid.Interval = 0; chartArea1.AxisY2.MajorGrid.IntervalOffset = 0; chartArea1.AxisY2.MajorGrid.IntervalOffsetType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Auto; chartArea1.AxisY2.MajorGrid.IntervalType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Auto; chartArea1.AxisY2.MajorTickMark.Interval = 0; chartArea1.AxisY2.MajorTickMark.IntervalOffset = 0; chartArea1.AxisY2.MajorTickMark.IntervalOffsetType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Auto; chartArea1.AxisY2.MajorTickMark.IntervalType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Auto; chartArea1.BackColor = System.Drawing.Color.Ivory; chartArea1.BackGradientStyle = System.Windows.Forms.DataVisualization.Charting.GradientStyle.TopBottom; chartArea1.BackSecondaryColor = System.Drawing.Color.White; chartArea1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.BorderDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Solid; chartArea1.Name = "Default"; chartArea1.ShadowColor = System.Drawing.Color.Transparent; this.chart1.ChartAreas.Add(chartArea1); legend1.Alignment = System.Drawing.StringAlignment.Far; legend1.BackColor = System.Drawing.Color.Transparent; legend1.Enabled = false; legend1.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); legend1.IsTextAutoFit = false; legend1.Name = "Default"; legend1.Position.Auto = false; legend1.Position.Height = 15F; legend1.Position.Width = 30F; legend1.Position.X = 63F; legend1.Position.Y = 5F; this.chart1.Legends.Add(legend1); this.chart1.Location = new System.Drawing.Point(16, 48); this.chart1.Name = "chart1"; series1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(180)))), ((int)(((byte)(26)))), ((int)(((byte)(59)))), ((int)(((byte)(105))))); series1.BorderWidth = 2; series1.ChartArea = "Default"; series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; series1.CustomProperties = "LabelStyle=\"down\""; series1.Legend = "Default"; series1.MarkerStyle = System.Windows.Forms.DataVisualization.Charting.MarkerStyle.Circle; series1.Name = "Series1"; series1.ShadowOffset = 1; this.chart1.Series.Add(series1); this.chart1.Size = new System.Drawing.Size(412, 296); this.chart1.TabIndex = 0; // // labelSampleComment // this.labelSampleComment.Font = new System.Drawing.Font("Verdana", 11F); this.labelSampleComment.Location = new System.Drawing.Point(16, 8); this.labelSampleComment.Name = "labelSampleComment"; this.labelSampleComment.Size = new System.Drawing.Size(702, 34); this.labelSampleComment.TabIndex = 2; this.labelSampleComment.Text = "This sample demonstrates the�mean, standard deviation, and median formulas."; this.labelSampleComment.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // panel1 // this.panel1.Controls.Add(this.label5); this.panel1.Controls.Add(this.label6); this.panel1.Controls.Add(this.label3); this.panel1.Controls.Add(this.label4); this.panel1.Controls.Add(this.label2); this.panel1.Controls.Add(this.label1); this.panel1.Controls.Add(this.button1); this.panel1.Location = new System.Drawing.Point(432, 56); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(292, 288); this.panel1.TabIndex = 1; // // label5 // this.label5.Location = new System.Drawing.Point(168, 72); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(112, 23); this.label5.TabIndex = 13; this.label5.Text = "label5"; this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label6 // this.label6.Location = new System.Drawing.Point(56, 72); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(100, 23); this.label6.TabIndex = 12; this.label6.Text = "Median:"; this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label3 // this.label3.Location = new System.Drawing.Point(168, 40); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(112, 23); this.label3.TabIndex = 11; this.label3.Text = "label3"; this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label4 // this.label4.Location = new System.Drawing.Point(16, 40); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(144, 23); this.label4.TabIndex = 10; this.label4.Text = "Standard Deviation:"; this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label2 // this.label2.Location = new System.Drawing.Point(168, 8); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(112, 23); this.label2.TabIndex = 9; this.label2.Text = "label2"; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label1 // this.label1.Location = new System.Drawing.Point(40, 8); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(120, 23); this.label1.TabIndex = 8; this.label1.Text = "Mean:"; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // button1 // this.button1.BackColor = System.Drawing.SystemColors.Control; this.button1.Location = new System.Drawing.Point(96, 104); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(152, 23); this.button1.TabIndex = 7; this.button1.Text = "&Random Data"; this.button1.UseVisualStyleBackColor = false; this.button1.Click += new System.EventHandler(this.button1_Click); // // label7 // this.label7.Font = new System.Drawing.Font("Verdana", 11F); this.label7.Location = new System.Drawing.Point(13, 352); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(702, 34); this.label7.TabIndex = 3; this.label7.Text = "Standard deviation is represented by the light blue strip line."; this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // DescriptiveStatistics // this.BackColor = System.Drawing.Color.White; this.Controls.Add(this.label7); this.Controls.Add(this.panel1); this.Controls.Add(this.labelSampleComment); this.Controls.Add(this.chart1); this.Font = new System.Drawing.Font("Verdana", 9F); this.Name = "DescriptiveStatistics"; this.Size = new System.Drawing.Size(728, 480); this.Load += new System.EventHandler(this.TemplateSampleControl_Load); ((System.ComponentModel.ISupportInitialize)(this.chart1)).EndInit(); this.panel1.ResumeLayout(false); this.ResumeLayout(false); }
/// <summary> /// Dumps the Column/Rows determination (based on aspect ratio) Plot. /// </summary> /// <param name="filename">name of the image file to write to.</param> /// <param name="plotThresholds">if set to <c>true</c> plot threshold info.</param> private void DumpColRowsPlot(string filename, bool plotThresholds) { bool detailsPage; int nThumbs, nCols, nRows; double crossoverThreshold; filename = System.IO.Path.GetFileNameWithoutExtension (filename) + ".png"; if (System.IO.File.Exists (filename)) { Console.Write ("'{0}' already exists. Overwrite (Y/N) [N]?", filename); string answer = Console.ReadLine (); answer = answer.Trim ().ToLower (); if (answer != "y" && answer != "yes") { Console.Write ("Aborting operation."); return; } } if (_tnSettings.Interval.TotalSeconds > 0) { detailsPage = true; nThumbs = _tnSettings.DetailThumbs; nCols = _tnSettings.DetailColumns; nRows = _tnSettings.DetailRows; crossoverThreshold = _tnSettings.DetailThreshold; } else { detailsPage = false; nThumbs = _tnSettings.OverviewThumbs; nCols = _tnSettings.OverviewColumns; nRows = _tnSettings.OverviewRows; crossoverThreshold = _tnSettings.OverviewThreshold; } THelper.Information (""); THelper.Information ("Dumping Column/Rows Determination Plot"); THelper.Information ("Page: {0} {1}x{2} ({3:F2}:1)", detailsPage ? "Detail" : "Overview", _tnSettings.Width, _tnSettings.Height, _tnSettings.AspectRatio); THelper.Information ("Layout Mode: {0}", _tnSettings.LayoutMode); if (_tnSettings.LayoutMode == ThumbnailSettings.LayoutModes.Auto) THelper.Information ("Threshold: {0:F2}", crossoverThreshold); if (_tnSettings.LayoutMode == ThumbnailSettings.LayoutModes.Actual) { THelper.Information ("Actual: {1}x{2}", nCols, nRows); } else { THelper.Information ("RC Optimization: {0}", _tnSettings.RCOptimization); THelper.Information ("Max RC Opt Steps: {0}", _tnSettings.MaxOptimizationSteps); THelper.Information ("Desired: {0} thumbs", nThumbs); THelper.Information ("Minimum: {0} columns, {1} rows", _tnSettings.MinColumns, _tnSettings.MinRows); } THelper.Information (""); System.Drawing.Font titleFont = new System.Drawing.Font ("Ariel", 24, System.Drawing.FontStyle.Bold); System.Drawing.Font subTitleFont = new System.Drawing.Font ("Ariel", 13, System.Drawing.FontStyle.Bold); System.Drawing.Font axisLabelFont = new System.Drawing.Font ("Ariel", 20, System.Drawing.FontStyle.Bold); System.Drawing.Font axisFont = new System.Drawing.Font ("Ariel", 12, System.Drawing.FontStyle.Bold); System.Drawing.Font annotationFont = new System.Drawing.Font ("Ariel", 10, System.Drawing.FontStyle.Regular); System.Drawing.Font annotationItFont = new System.Drawing.Font ("Ariel", 10, System.Drawing.FontStyle.Italic); Charting.Chart chart = new Charting.Chart (); Charting.ChartArea chartArea = chart.ChartAreas.Add ("Wasted"); Charting.Legend legend = new Charting.Legend ("Wasted"); legend.DockedToChartArea = "Wasted"; legend.Font = axisFont; legend.Docking = Charting.Docking.Bottom; legend.Alignment = System.Drawing.StringAlignment.Far; legend.LegendStyle = Charting.LegendStyle.Column; chart.Legends.Add (legend); Charting.LabelStyle labelStyle1 = new Charting.LabelStyle(); labelStyle1.Font = axisFont; Charting.LabelStyle labelStyle2 = new Charting.LabelStyle (); labelStyle2.Font = axisFont; Charting.LabelStyle labelStyle3 = new Charting.LabelStyle (); labelStyle3.Font = axisFont; chart.BackColor = System.Drawing.Color.Wheat; chartArea.BorderWidth = 3; chartArea.BorderDashStyle = Charting.ChartDashStyle.Solid; //chartArea.BorderColor = System.Drawing.Color.Violet; legend.BackColor = System.Drawing.Color.Wheat; string titleStr = "Optimum Number of Columns & Rows"; if (plotThresholds) titleStr += "\nUsing % Wasted Thumbnail Width & Height"; Charting.Title title = chart.Titles.Add (titleStr); title.Font = titleFont; //subTitle.DockingOffset = -2; Charting.TextAnnotation desired = new Charting.TextAnnotation (); desired.Font = subTitleFont; switch (_tnSettings.LayoutMode) { case ThumbnailSettings.LayoutModes.Auto: chartArea.BackColor = System.Drawing.Color.Beige; desired.Text = String.Format ( "{0} Cols or Rows; Min {1} Cols, {2} Rows; {3} Max Opt Steps", nThumbs, _tnSettings.MinColumns, _tnSettings.MinRows, _tnSettings.MaxOptimizationSteps); break; case ThumbnailSettings.LayoutModes.Actual: chartArea.BackColor = System.Drawing.Color.Ivory; desired.Text = String.Format ("{0} Columns and {1} Rows", nCols, nRows); break; case ThumbnailSettings.LayoutModes.RowPriority: chartArea.BackColor = System.Drawing.Color.Beige; desired.Text = String.Format ( "{0} Rows; Min {1} Columns; {2} Max Opt Steps", nThumbs, _tnSettings.MinColumns, _tnSettings.MaxOptimizationSteps); break; case ThumbnailSettings.LayoutModes.ColumnPriority: chartArea.BackColor = System.Drawing.Color.AliceBlue; desired.Text = String.Format ( "{0} Columns; Min {1} Rows; {2} Max Opt Steps", nThumbs, _tnSettings.MinRows, _tnSettings.MaxOptimizationSteps); break; } desired.Text += detailsPage ? "\nDetail Page" : "\nOverview Page"; desired.Text += String.Format (" {0}x{1} ({2:F2}:1)", _tnSettings.Width, _tnSettings.Height, _tnSettings.AspectRatio); desired.Alignment = System.Drawing.ContentAlignment.BottomLeft; desired.X = 1; desired.Y = 95; chart.Annotations.Add (desired); Charting.TextAnnotation layout = new Charting.TextAnnotation (); layout.Font = subTitleFont; layout.Text = String.Format("{0} Layout Mode", _tnSettings.LayoutMode); if (_tnSettings.LayoutMode != ThumbnailSettings.LayoutModes.Actual) layout.Text += String.Format ("\nRow/Column Optimization {0}", _tnSettings.RCOptimization ? "enabled" : "disabled"); layout.Alignment = System.Drawing.ContentAlignment.BottomRight; layout.X = 77; layout.Y = 95; chart.Annotations.Add (layout); chart.Width = 1280; chart.Height = 1024; int lineWidth = 5; int dotsWidth = 2; chartArea.AxisX.Title = "Video Aspect Ratio"; chartArea.AxisX.TitleFont = axisLabelFont; chartArea.AxisX.MajorGrid.Enabled = false; chartArea.AxisX.MajorTickMark.Interval = 0.10; chartArea.AxisX.Minimum = 1.0; chartArea.AxisX.Maximum = 3.0; chartArea.AxisX.Interval = 0.5; chartArea.AxisX.LineWidth = 3; chartArea.AxisX.MajorTickMark.LineWidth = 3; chartArea.AxisX.LabelStyle = labelStyle1; chartArea.AxisX.LabelStyle.Format = "F2"; chartArea.AxisX.IsMarginVisible = true; if (_tnSettings.LayoutMode == ThumbnailSettings.LayoutModes.Auto && crossoverThreshold > 1.0) { Charting.StripLine stripLine = new Charting.StripLine (); stripLine.IntervalOffset = 0.0; stripLine.StripWidth = crossoverThreshold - 1.0; stripLine.Interval = 10000; stripLine.BackColor = System.Drawing.Color.AliceBlue; chartArea.AxisX.StripLines.Add (stripLine); } chartArea.AxisY.Title = "# of Columns or Rows"; chartArea.AxisY.TitleFont = axisLabelFont; chartArea.AxisY.MajorGrid.Enabled = false; chartArea.AxisY.MajorTickMark.Interval = 1.0; chartArea.AxisY.LineWidth = 3; chartArea.AxisY.MajorTickMark.LineWidth = 3; chartArea.AxisY.LabelStyle = labelStyle2; //chartArea.AxisY.LabelStyle.IsEndLabelVisible = false; chartArea.AxisY.IsMarginVisible = true; if (!plotThresholds) { chartArea.AxisY2.Enabled = Charting.AxisEnabled.True; //chartArea.AxisY2.Title = "# of Columns or Rows"; chartArea.AxisY2.TitleFont = axisLabelFont; chartArea.AxisY2.MajorGrid.Enabled = false; chartArea.AxisY2.MajorTickMark.Interval = 1.0; chartArea.AxisY2.LineWidth = 3; chartArea.AxisY2.MajorTickMark.LineWidth = 3; chartArea.AxisY2.LabelStyle = labelStyle3; //chartArea.AxisY2.LabelStyle.IsEndLabelVisible = false; chartArea.AxisY2.IsMarginVisible = true; } Charting.Series seriesNCols = chart.Series.Add ("# of Columns"); seriesNCols.ChartType = Charting.SeriesChartType.StepLine; seriesNCols.ChartArea = "Wasted"; seriesNCols.Legend = "Wasted"; seriesNCols.IsVisibleInLegend = true; seriesNCols.BorderWidth = lineWidth; Charting.Series seriesNRows = chart.Series.Add ("# of Rows"); seriesNRows.ChartType = Charting.SeriesChartType.StepLine; seriesNRows.ChartArea = "Wasted"; seriesNRows.Legend = "Wasted"; seriesNRows.IsVisibleInLegend = true; seriesNRows.BorderWidth = lineWidth; Charting.Series seriesWW = null; Charting.Series seriesWH = null; if (plotThresholds) { chartArea.AxisY2.Title = "% Wasted Thumbnail Width or Height"; chartArea.AxisY2.TitleFont = axisLabelFont; chartArea.AxisY2.MajorGrid.Enabled = false; chartArea.AxisY2.LineWidth = 3; chartArea.AxisY2.MajorTickMark.LineWidth = 3; chartArea.AxisY2.LabelStyle = labelStyle3; //chartArea.AxisY2.LabelStyle.IsEndLabelVisible = false; chartArea.AxisY2.Maximum = 100.0; seriesWW = chart.Series.Add ("%Wasted Width"); seriesWW.ChartType = Charting.SeriesChartType.Line; seriesWW.ChartArea = "Wasted"; seriesWW.Legend = "Wasted"; seriesWW.IsVisibleInLegend = true; seriesWW.BorderWidth = dotsWidth; seriesWW.BorderDashStyle = Charting.ChartDashStyle.Dot; seriesWW.YAxisType = Charting.AxisType.Secondary; seriesWH = chart.Series.Add ("%Wasted Height"); seriesWH.ChartType = Charting.SeriesChartType.Line; seriesWH.ChartArea = "Wasted"; seriesWH.Legend = "Wasted"; seriesWH.IsVisibleInLegend = true; seriesWH.BorderWidth = dotsWidth; seriesWH.BorderDashStyle = Charting.ChartDashStyle.Dot; seriesWH.YAxisType = Charting.AxisType.Secondary; } ThumbnailCreator creator = new ThumbnailCreator (_tnSettings, null); ThumbnailPageLayout container = new ThumbnailPageLayout (_tnSettings); ThumbnailPageLayout newContainer; double wastedWidth, wastedHeight; int extraWidth, extraHeight; double extraWidthPercent, extraHeightPercent; for (double aspectRatio=1.0; aspectRatio <= 3.0; aspectRatio += 0.01) { _tnSettings.ThumbAspectRatio = aspectRatio; ThumbnailGrid tg = creator.CreateThumbnailGrid(_tnSettings.LayoutMode, nThumbs, nCols, nRows, crossoverThreshold); newContainer = tg.Layout; container.CalcWasted (_tnSettings, tg, out wastedWidth, out wastedHeight); extraWidth = (int) (wastedWidth * tg.ThumbWidth); extraHeight = (int) (wastedHeight * tg.ThumbHeight); extraWidthPercent = 100.0 * extraWidth / newContainer.Width; extraHeightPercent = 100.0 * extraHeight / newContainer.Height; THelper.Information (String.Format ( "{9,4}x{10,4} ({13,4:F2}) {0,4:F2} {1,2}x{2,2} {3,3:D}x{4,3:D} " + "{5,6:F2}x{6,6:F2} {7,3:D}x{8,3:D} {11:F1}x{12:F1}", aspectRatio, tg.NColumns, tg.NRows, tg.ThumbWidth, tg.ThumbHeight, wastedWidth, wastedHeight, extraWidth, extraHeight, newContainer.Width, newContainer.Height, extraWidthPercent, extraHeightPercent, newContainer.AspectRatio )); int index; if (plotThresholds) { index = seriesWW.Points.AddXY (aspectRatio, wastedWidth * 100.0); if (wastedWidth == 0.0) seriesWW.Points[index].IsEmpty = true; index = seriesWH.Points.AddXY (aspectRatio, wastedHeight * 100.0); if (wastedHeight == 0.0) seriesWH.Points[index].IsEmpty = true; } seriesNCols.Points.AddXY (aspectRatio, tg.NColumns); seriesNRows.Points.AddXY (aspectRatio, tg.NRows); } chartArea.RecalculateAxesScale (); AddARAnnotation (chart, "Fullscreen 4:3\n(1.33)", 1.33, annotationFont, plotThresholds); AddARAnnotation (chart, "HD 16:9\n(1.78)", 1.78, annotationFont, plotThresholds); AddARAnnotation (chart, "Widescreen\n(1.85)", 1.85, annotationFont, plotThresholds); AddARAnnotation (chart, "CinemaScope\n(2.35)", 2.35, annotationFont, plotThresholds); AddARAnnotation (chart, "Ultra-Panavision\n(2.76)", 2.76, annotationFont, plotThresholds); AddARAnnotation (chart, String.Format ("Layout Threshold\n({0:F2})", crossoverThreshold), crossoverThreshold, _tnSettings.LayoutMode == ThumbnailSettings.LayoutModes.Auto ? annotationFont : annotationItFont, plotThresholds, true); if (_tnSettings.RCOptimization && plotThresholds) { switch (_tnSettings.LayoutMode) { case ThumbnailSettings.LayoutModes.Auto: if (_tnSettings.WidthThreshold == _tnSettings.HeightThreshold) AddThresholdAnnotation (chart, String.Format ("Width & Height Threshold\n" + "({0:F2})", _tnSettings.WidthThreshold), _tnSettings.WidthThreshold, annotationFont); else { AddThresholdAnnotation (chart, String.Format ("Width Threshold\n" + "({0:F2})", _tnSettings.WidthThreshold), _tnSettings.WidthThreshold, annotationFont); AddThresholdAnnotation (chart, String.Format ("Height Threshold\n" + "({0:F2})", _tnSettings.HeightThreshold), _tnSettings.HeightThreshold, annotationFont); } break; case ThumbnailSettings.LayoutModes.RowPriority: AddThresholdAnnotation (chart, String.Format ("Width Threshold\n" + "({0:F2})", _tnSettings.WidthThreshold), _tnSettings.WidthThreshold, annotationFont); break; case ThumbnailSettings.LayoutModes.ColumnPriority: AddThresholdAnnotation (chart, String.Format ("Height Threshold\n" + "({0:F2})", _tnSettings.HeightThreshold), _tnSettings.HeightThreshold, annotationFont); break; } } chart.SaveImage (filename, Charting.ChartImageFormat.Png); THelper.Information ("'{0}' created.", filename); labelStyle1.Dispose (); labelStyle2.Dispose (); labelStyle3.Dispose (); titleFont.Dispose (); subTitleFont.Dispose (); axisFont.Dispose (); annotationFont.Dispose (); annotationItFont.Dispose (); chart.Dispose (); }
private void AddThresholdAnnotation(Charting.Chart chart, string name, double threshold, System.Drawing.Font font) { Charting.Axis axisX = chart.ChartAreas[0].AxisX; Charting.Axis axisY = chart.ChartAreas[0].AxisY2; Charting.StripLine stripLine = new Charting.StripLine (); stripLine.StripWidth = 0.0; stripLine.Interval = 0; stripLine.BorderColor = System.Drawing.Color.Red; stripLine.BorderDashStyle = Charting.ChartDashStyle.DashDotDot; stripLine.IntervalOffset = threshold * 100.0; axisY.StripLines.Add (stripLine); Charting.RectangleAnnotation ta = new Charting.RectangleAnnotation (); ta.Text = name; ta.IsSizeAlwaysRelative = false; ta.AxisX = axisX; ta.AxisY = axisY; ta.AnchorX = axisX.Maximum * (15.0 / 16.0); ta.AnchorY = threshold * 100.0; ta.Alignment = System.Drawing.ContentAlignment.MiddleCenter; ta.AnchorAlignment = System.Drawing.ContentAlignment.MiddleCenter; ta.ShadowOffset = 2; ta.Font = font; chart.Annotations.Add (ta); }
/// <summary> /// Adds an aspect ratio vertical line annotation. /// </summary> /// <param name="chart">The <see cref="Charting.Chart "/>.</param> /// <param name="name">The annotation text.</param> /// <param name="aspectRatio">The aspect ratio.</param> /// <param name="font">The font.</param> /// <param name="plotThresholds">if set to <c>true</c> plot threshold info.</param> /// <param name="isCrossover">if set to <c>true</c> is a crossover annotation.</param> private void AddARAnnotation(Charting.Chart chart, string name, double aspectRatio, System.Drawing.Font font, bool plotThresholds, bool isCrossover = false) { Charting.StripLine stripLine = new Charting.StripLine(); stripLine.StripWidth = 0.0; stripLine.Interval = 0; if (isCrossover) { stripLine.BorderColor = System.Drawing.Color.Red; stripLine.BorderDashStyle = Charting.ChartDashStyle.DashDotDot; } else { stripLine.BorderColor = System.Drawing.Color.Black; stripLine.BorderDashStyle = Charting.ChartDashStyle.Dash; } stripLine.IntervalOffset = aspectRatio; Charting.Axis axisX = chart.ChartAreas[0].AxisX; Charting.Axis axisY = chart.ChartAreas[0].AxisY; axisX.StripLines.Add (stripLine); double yRange = (axisY.Maximum - axisY.Minimum); Charting.RectangleAnnotation ta = new Charting.RectangleAnnotation(); ta.Text = name; ta.IsSizeAlwaysRelative = false; ta.AxisX = axisX; ta.AxisY = axisY; ta.AnchorX = aspectRatio; ta.AnchorY = axisY.Minimum + yRange * (15.0/16.0); ta.ShadowOffset = 2; ta.Font = font; if (isCrossover) ta.ForeColor = System.Drawing.Color.Red; chart.Annotations.Add (ta); }
private void CustomLabels_Load(object sender, System.EventArgs e) { // Populate series data Random random = new Random(); for(int pointIndex = 0; pointIndex < 5; pointIndex++) { Chart1.Series["Series1"].Points.AddXY(pointIndex+1, random.Next(10, 90)); } Axis axisX = Chart1.ChartAreas["Default"].AxisX; Axis axisY = Chart1.ChartAreas["Default"].AxisY; // Set Y axis custom labels axisY.CustomLabels.Add(0, 30,"Low"); axisY.CustomLabels.Add(30, 70, "Medium"); axisY.CustomLabels.Add(70,100,"High"); StripLine stripLow = new StripLine(); stripLow.IntervalOffset = 0; stripLow.StripWidth = 30; stripLow.BackColor = Color.FromArgb(64, Color.Green); StripLine stripMed = new StripLine(); stripMed.IntervalOffset = 30; stripMed.StripWidth = 40; stripMed.BackColor = Color.FromArgb(64, Color.Orange); StripLine stripHigh = new StripLine(); stripHigh.IntervalOffset = 70; stripHigh.StripWidth = 30; stripHigh.BackColor = Color.FromArgb(64, Color.Red); axisY.StripLines.Add(stripLow); axisY.StripLines.Add(stripMed); axisY.StripLines.Add(stripHigh); // Set X axis custom labels CustomLabel customLabel; customLabel = axisX.CustomLabels.Add(0.5, 1.5, "Jan"); customLabel.GridTicks = GridTickTypes.All; customLabel = axisX.CustomLabels.Add(1.5, 2.5, "Feb"); customLabel.GridTicks = GridTickTypes.TickMark; customLabel = axisX.CustomLabels.Add(2.5, 3.5, "Mar"); customLabel.GridTicks = GridTickTypes.All; customLabel = axisX.CustomLabels.Add(3.5, 4.5, "Apr"); customLabel.GridTicks = GridTickTypes.TickMark; customLabel = axisX.CustomLabels.Add(4.5, 5.5, "May"); customLabel.GridTicks = GridTickTypes.All; // set second row of labels axisX.CustomLabels.Add(1.0, 4.0, "Q1", 1, LabelMarkStyle.LineSideMark); axisX.CustomLabels.Add(4.0, 5.0, "Q2", 1, LabelMarkStyle.LineSideMark); // One more row of labels axisX.CustomLabels.Add(1.0, 5.0, "Year 2006", 2, LabelMarkStyle.LineSideMark); }
public void DisplayHistogram(bool IsFullScreen) { if (CompleteScreening == null) return; if ((CompleteScreening.ListDescriptors == null) || (CompleteScreening.ListDescriptors.Count == 0)) return; cExtendedList Pos = new cExtendedList(); cWell TempWell; if (IsFullScreen == false) { for (int row = 0; row < CompleteScreening.Rows; row++) for (int col = 0; col < CompleteScreening.Columns; col++) { TempWell = CompleteScreening.GetCurrentDisplayPlate().GetWell(col, row, false); if (TempWell == null) continue; else { if (TempWell.GetClass() == CompleteScreening.SelectedClass) Pos.Add(TempWell.ListDescriptors[CompleteScreening.ListDescriptors.CurrentSelectedDescriptor].GetValue()); } } } else { int NumberOfPlates = CompleteScreening.ListPlatesActive.Count; // loop on all the plate for (int PlateIdx = 0; PlateIdx < NumberOfPlates; PlateIdx++) { cPlate CurrentPlateToProcess = CompleteScreening.ListPlatesActive.GetPlate(CompleteScreening.ListPlatesActive[PlateIdx].Name); for (int row = 0; row < CompleteScreening.Rows; row++) for (int col = 0; col < CompleteScreening.Columns; col++) { TempWell = CurrentPlateToProcess.GetWell(col, row, false); if (TempWell == null) continue; else { if (TempWell.GetClass() == CompleteScreening.SelectedClass) Pos.Add(TempWell.ListDescriptors[CompleteScreening.ListDescriptors.CurrentSelectedDescriptor].GetValue()); } } } } if (Pos.Count == 0) { MessageBox.Show("No well of class " + CompleteScreening.SelectedClass + " selected !", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } List<double[]> HistoPos = CreateHistogram(Pos.ToArray(), (int)GlobalInfo.OptionsWindow.numericUpDownHistoBin.Value); SimpleForm NewWindow = new SimpleForm(); Series SeriesPos = new Series(); SeriesPos.ShadowOffset = 1; if (HistoPos.Count == 0) return; for (int IdxValue = 0; IdxValue < HistoPos[0].Length; IdxValue++) { SeriesPos.Points.AddXY(HistoPos[0][IdxValue], HistoPos[1][IdxValue]); SeriesPos.Points[IdxValue].ToolTip = HistoPos[1][IdxValue].ToString(); if (CompleteScreening.SelectedClass == -1) SeriesPos.Points[IdxValue].Color = Color.Black; else SeriesPos.Points[IdxValue].Color = CompleteScreening.GlobalInfo.GetColor(CompleteScreening.SelectedClass); } ChartArea CurrentChartArea = new ChartArea(); CurrentChartArea.BorderColor = Color.Black; NewWindow.chartForSimpleForm.ChartAreas.Add(CurrentChartArea); CurrentChartArea.Axes[0].MajorGrid.Enabled = false; CurrentChartArea.Axes[0].Title = CompleteScreening.ListDescriptors[CompleteScreening.ListDescriptors.CurrentSelectedDescriptor].GetName(); CurrentChartArea.Axes[1].Title = "Sum"; CurrentChartArea.AxisX.LabelStyle.Format = "N2"; NewWindow.chartForSimpleForm.TextAntiAliasingQuality = TextAntiAliasingQuality.High; CurrentChartArea.BackGradientStyle = GradientStyle.TopBottom; CurrentChartArea.BackColor = CompleteScreening.GlobalInfo.OptionsWindow.panel1.BackColor; CurrentChartArea.BackSecondaryColor = Color.White; SeriesPos.ChartType = SeriesChartType.Column; SeriesPos.Color = CompleteScreening.GlobalInfo.GetColor(1); NewWindow.chartForSimpleForm.Series.Add(SeriesPos); //Series SeriesGaussNeg = new Series(); //SeriesGaussNeg.ChartType = SeriesChartType.Spline; //Series SeriesGaussPos = new Series(); //SeriesGaussPos.ChartType = SeriesChartType.Spline; //if (HistoPos.Count != 0) //{ // double[] HistoGaussPos = CreateGauss(Mean(Pos.ToArray()), std(Pos.ToArray()), HistoPos[0].Length); // SeriesGaussPos.Color = Color.Black; // SeriesGaussPos.BorderWidth = 2; //} //SeriesGaussNeg.Color = Color.Black; //SeriesGaussNeg.BorderWidth = 2; //NewWindow.chartForSimpleForm.Series.Add(SeriesGaussNeg); // NewWindow.chartForSimpleForm.Series.Add(SeriesGaussPos); NewWindow.chartForSimpleForm.ChartAreas[0].CursorX.IsUserEnabled = true; NewWindow.chartForSimpleForm.ChartAreas[0].CursorX.IsUserSelectionEnabled = true; NewWindow.chartForSimpleForm.ChartAreas[0].AxisX.ScaleView.Zoomable = true; NewWindow.chartForSimpleForm.ChartAreas[0].AxisX.ScrollBar.IsPositionedInside = true; if (GlobalInfo.OptionsWindow.checkBoxDisplayHistoStats.Checked) { StripLine AverageLine = new StripLine(); AverageLine.BackColor = Color.Black; AverageLine.IntervalOffset = Pos.Mean(); AverageLine.StripWidth = double.Epsilon; CurrentChartArea.AxisX.StripLines.Add(AverageLine); AverageLine.Text = String.Format("{0:0.###}", AverageLine.IntervalOffset); StripLine StdLine = new StripLine(); StdLine.BackColor = Color.FromArgb(64, Color.Black); double Std = Pos.Std(); StdLine.IntervalOffset = AverageLine.IntervalOffset - 0.5 * Std; StdLine.StripWidth = Std; CurrentChartArea.AxisX.StripLines.Add(StdLine); AverageLine.StripWidth = 0.0001; } Title CurrentTitle = null; if (IsFullScreen) CurrentTitle = new Title("Class " + CompleteScreening.SelectedClass + " - " + CompleteScreening.ListDescriptors[CompleteScreening.ListDescriptors.CurrentSelectedDescriptor].GetName() + " histogram."); else CurrentTitle = new Title("Class " + CompleteScreening.SelectedClass + " - " + CompleteScreening.GetCurrentDisplayPlate().Name + " - " + CompleteScreening.ListDescriptors[CompleteScreening.ListDescriptors.CurrentSelectedDescriptor].GetName() + " histogram."); CurrentTitle.Font = new System.Drawing.Font("Arial", 11, FontStyle.Bold); NewWindow.chartForSimpleForm.Titles.Add(CurrentTitle); NewWindow.Text = CurrentTitle.Text; NewWindow.Show(); NewWindow.chartForSimpleForm.Update(); NewWindow.chartForSimpleForm.Show(); NewWindow.Controls.AddRange(new System.Windows.Forms.Control[] { NewWindow.chartForSimpleForm }); return; }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); System.Windows.Forms.DataVisualization.Charting.StripLine stripLine1 = new System.Windows.Forms.DataVisualization.Charting.StripLine(); System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend(); System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series(); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint1 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 5); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint2 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 9); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint3 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 7); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint4 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 6); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint5 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 3); System.Windows.Forms.DataVisualization.Charting.Title title1 = new System.Windows.Forms.DataVisualization.Charting.Title(); this.label9 = new System.Windows.Forms.Label(); this.panel1 = new System.Windows.Forms.Panel(); this.label6 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.label15 = new System.Windows.Forms.Label(); this.Chart1 = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.Chart1)).BeginInit(); this.SuspendLayout(); // // label9 // this.label9.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.label9.Font = new System.Drawing.Font("Verdana", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label9.Location = new System.Drawing.Point(16, 14); this.label9.Name = "label9"; this.label9.Size = new System.Drawing.Size(702, 39); this.label9.TabIndex = 0; this.label9.Text = "This sample lets you change the value and appearance of a data point. Click on th" + "e data point to display its property dialog."; this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // panel1 // this.panel1.Controls.Add(this.label6); this.panel1.Controls.Add(this.label5); this.panel1.Controls.Add(this.label4); this.panel1.Controls.Add(this.label3); this.panel1.Controls.Add(this.label15); this.panel1.Location = new System.Drawing.Point(432, 69); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(292, 288); this.panel1.TabIndex = 19; // // label6 // this.label6.Location = new System.Drawing.Point(64, 403); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(100, 23); this.label6.TabIndex = 5; this.label6.Text = "Border Size:"; // // label5 // this.label5.Location = new System.Drawing.Point(64, 380); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(100, 23); this.label5.TabIndex = 4; this.label5.Text = "Border Color:"; // // label4 // this.label4.Location = new System.Drawing.Point(64, 357); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(100, 23); this.label4.TabIndex = 3; this.label4.Text = "Hatch Style:"; // // label3 // this.label3.Location = new System.Drawing.Point(64, 334); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(100, 23); this.label3.TabIndex = 2; this.label3.Text = "Gradient:"; // // label15 // this.label15.Location = new System.Drawing.Point(64, 426); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(100, 23); this.label15.TabIndex = 5; this.label15.Text = "Border Size:"; // // Chart1 // this.Chart1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(211)))), ((int)(((byte)(223)))), ((int)(((byte)(240))))); this.Chart1.BackGradientStyle = System.Windows.Forms.DataVisualization.Charting.GradientStyle.TopBottom; this.Chart1.BackSecondaryColor = System.Drawing.Color.White; this.Chart1.BorderlineColor = System.Drawing.Color.FromArgb(((int)(((byte)(26)))), ((int)(((byte)(59)))), ((int)(((byte)(105))))); this.Chart1.BorderlineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Solid; this.Chart1.BorderlineWidth = 2; this.Chart1.BorderSkin.SkinStyle = System.Windows.Forms.DataVisualization.Charting.BorderSkinStyle.Emboss; chartArea1.Area3DStyle.Inclination = 15; chartArea1.Area3DStyle.IsClustered = true; chartArea1.Area3DStyle.IsRightAngleAxes = false; chartArea1.Area3DStyle.Perspective = 10; chartArea1.Area3DStyle.Rotation = 10; chartArea1.Area3DStyle.WallWidth = 0; chartArea1.AxisX.IsLabelAutoFit = false; chartArea1.AxisX.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); chartArea1.AxisX.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisX.MajorGrid.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisX2.Enabled = System.Windows.Forms.DataVisualization.Charting.AxisEnabled.False; chartArea1.AxisY.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); chartArea1.AxisY.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisY.MajorGrid.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); stripLine1.Interval = 4; stripLine1.IntervalOffset = 2; stripLine1.StripWidth = 2; chartArea1.AxisY.StripLines.Add(stripLine1); chartArea1.AxisY2.Enabled = System.Windows.Forms.DataVisualization.Charting.AxisEnabled.False; chartArea1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(165)))), ((int)(((byte)(191)))), ((int)(((byte)(228))))); chartArea1.BackGradientStyle = System.Windows.Forms.DataVisualization.Charting.GradientStyle.TopBottom; chartArea1.BackSecondaryColor = System.Drawing.Color.White; chartArea1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.BorderDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Solid; chartArea1.Name = "Default"; chartArea1.ShadowColor = System.Drawing.Color.Transparent; this.Chart1.ChartAreas.Add(chartArea1); legend1.BackColor = System.Drawing.Color.Transparent; legend1.DockedToChartArea = "Default"; legend1.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); legend1.IsTextAutoFit = false; legend1.Name = "Default"; this.Chart1.Legends.Add(legend1); this.Chart1.Location = new System.Drawing.Point(16, 61); this.Chart1.Name = "Chart1"; series1.BorderColor = System.Drawing.Color.SlateGray; series1.ChartArea = "Default"; series1.Color = System.Drawing.Color.DodgerBlue; series1.Legend = "Default"; series1.MarkerBorderColor = System.Drawing.Color.Black; series1.MarkerColor = System.Drawing.Color.Gold; series1.MarkerSize = 8; series1.MarkerStyle = System.Windows.Forms.DataVisualization.Charting.MarkerStyle.Circle; series1.Name = "Series1"; dataPoint1.Label = "USA"; dataPoint2.Label = "Canada"; dataPoint3.Label = "Spain"; dataPoint4.Label = "France"; dataPoint5.Label = "Italy"; series1.Points.Add(dataPoint1); series1.Points.Add(dataPoint2); series1.Points.Add(dataPoint3); series1.Points.Add(dataPoint4); series1.Points.Add(dataPoint5); series1.ShadowColor = System.Drawing.Color.Black; series1.ShadowOffset = 1; this.Chart1.Series.Add(series1); this.Chart1.Size = new System.Drawing.Size(412, 296); this.Chart1.TabIndex = 0; title1.Font = new System.Drawing.Font("Trebuchet MS", 14.25F, System.Drawing.FontStyle.Bold); title1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(26)))), ((int)(((byte)(59)))), ((int)(((byte)(105))))); title1.Name = "Title1"; title1.ShadowColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); title1.ShadowOffset = 3; title1.Text = "Selection"; this.Chart1.Titles.Add(title1); this.Chart1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Chart1_MouseMove); this.Chart1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Chart1_MouseDown); // // Selection // this.BackColor = System.Drawing.Color.White; this.Controls.Add(this.Chart1); this.Controls.Add(this.panel1); this.Controls.Add(this.label9); this.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Name = "Selection"; this.Size = new System.Drawing.Size(728, 352); this.panel1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.Chart1)).EndInit(); this.ResumeLayout(false); }
private void scatterPointsToolStripMenuItem1_Click(object sender, EventArgs e) { if (CompleteScreening == null) return; SimpleForm NewWindow = new SimpleForm(CompleteScreening); Series CurrentSeries = new Series("ScatterPoints"); CurrentSeries.ShadowOffset = 1; int Idx = 0; for (int IdxValue = 0; IdxValue < CompleteScreening.Columns; IdxValue++) for (int IdxValue0 = 0; IdxValue0 < CompleteScreening.Rows; IdxValue0++) { cWell TmpWell = CompleteScreening.GetCurrentDisplayPlate().GetWell(IdxValue, IdxValue0, true); if (TmpWell != null) { CurrentSeries.Points.Add(TmpWell.ListDescriptors[comboBoxDescriptorToDisplay.SelectedIndex].GetValue()); CurrentSeries.Points[Idx].Color = CompleteScreening.GetCurrentDisplayPlate().GetWell(IdxValue, IdxValue0, true).GetColor(); CurrentSeries.Points[Idx].ToolTip = TmpWell.GetPosX() + "x" + TmpWell.GetPosY() + " :" + TmpWell.Name; CurrentSeries.Points[Idx].Tag = TmpWell; CurrentSeries.Points[Idx].MarkerStyle = MarkerStyle.Circle; CurrentSeries.Points[Idx].MarkerSize = 8; Idx++; } } if (CurrentSeries.Points.Count < 2) { MessageBox.Show("Statistical Analyses - More than one data point needed.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } ChartArea CurrentChartArea = new ChartArea(); CurrentChartArea.CursorX.IsUserSelectionEnabled = true; CurrentChartArea.BorderColor = Color.Black; NewWindow.chartForSimpleForm.ChartAreas.Add(CurrentChartArea); NewWindow.chartForSimpleForm.TextAntiAliasingQuality = TextAntiAliasingQuality.High; CurrentChartArea.BackColor = Color.FromArgb(164, 164, 164); CurrentChartArea.Axes[1].Title = CompleteScreening.ListDescriptors[CompleteScreening.ListDescriptors.CurrentSelectedDescriptor].GetName(); CurrentChartArea.Axes[0].Title = "Index"; CurrentChartArea.Axes[0].MajorGrid.Enabled = false; CurrentSeries.ChartType = SeriesChartType.Point; NewWindow.chartForSimpleForm.Series.Add(CurrentSeries); double Av = NewWindow.chartForSimpleForm.DataManipulator.Statistics.Mean("ScatterPoints"); double Std = Math.Sqrt(NewWindow.chartForSimpleForm.DataManipulator.Statistics.Variance("ScatterPoints", true)); StripLine StdLine = new StripLine(); StdLine.BackColor = Color.FromArgb(64, Color.BlanchedAlmond); StdLine.IntervalOffset = Av - 1.5 * Std; StdLine.StripWidth = 3 * Std; CurrentChartArea.AxisY.StripLines.Add(StdLine); StripLine AverageLine = new StripLine(); AverageLine.BackColor = Color.Red; AverageLine.IntervalOffset = Av; AverageLine.StripWidth = 0.01; AverageLine.Text = String.Format("{0:0.###}", Av); CurrentChartArea.AxisY.StripLines.Add(AverageLine); NewWindow.Text = "Scatter Point / " + CompleteScreening.GetCurrentDisplayPlate().GetNumberOfActiveWells() + " points"; NewWindow.Show(); NewWindow.chartForSimpleForm.Update(); NewWindow.chartForSimpleForm.Show(); NewWindow.Controls.AddRange(new System.Windows.Forms.Control[] { NewWindow.chartForSimpleForm }); return; }
private void TemplateSampleControl_Load(object sender, System.EventArgs e) { // Set current selection comboBoxNumberOfDays.SelectedIndex = 1; comboBoxPointsFilter.SelectedIndex = 0; comboBoxShowAsIndexed.SelectedIndex = 0; // Fill chart data FillData(); // Set settings UpdateChartSettings(); // Create strip lines on the weekends StripLine stripLine = new StripLine(); stripLine.BackColor = Color.FromArgb(120, Color.Gray); stripLine.IntervalOffset = -1.5; stripLine.IntervalOffsetType = DateTimeIntervalType.Days; stripLine.Interval = 1; stripLine.IntervalType = DateTimeIntervalType.Weeks; stripLine.StripWidth = 2; stripLine.StripWidthType = DateTimeIntervalType.Days; chart1.ChartAreas["Default"].AxisX.StripLines.Add(stripLine); }
private void scatterPointsToolStripMenuItem_Click(object sender, EventArgs e) { if (CompleteScreening == null) return; Series CurrentSeries = new Series("ScatterPoints"); CurrentSeries.ShadowOffset = 1; int Idx = 0; int NumberOfPlates = CompleteScreening.ListPlatesActive.Count; // loop on all the plate for (int PlateIdx = 0; PlateIdx < NumberOfPlates; PlateIdx++) { cPlate CurrentPlateToProcess = CompleteScreening.ListPlatesActive.GetPlate(CompleteScreening.ListPlatesActive[PlateIdx].Name); for (int IdxValue = 0; IdxValue < CompleteScreening.Columns; IdxValue++) for (int IdxValue0 = 0; IdxValue0 < CompleteScreening.Rows; IdxValue0++) { cWell TmpWell = CurrentPlateToProcess.GetWell(IdxValue, IdxValue0, true); if (TmpWell == null) continue; CurrentSeries.Points.Add(TmpWell.ListDescriptors[comboBoxDescriptorToDisplay.SelectedIndex].GetValue()); CurrentSeries.Points[Idx].Color = TmpWell.GetColor(); CurrentSeries.Points[Idx].MarkerStyle = MarkerStyle.Circle; CurrentSeries.Points[Idx].MarkerSize = 6; if (!GlobalInfo.OptionsWindow.checkBoxDisplayFastPerformance.Checked) CurrentSeries.Points[Idx].ToolTip = TmpWell.AssociatedPlate.Name + "\n" + TmpWell.GetPosX() + "x" + TmpWell.GetPosY() + " :" + TmpWell.Name; Idx++; } } SimpleForm NewWindow = new SimpleForm(CompleteScreening); if (Idx > (int)GlobalInfo.OptionsWindow.numericUpDownMaximumWidth.Value) NewWindow.Width = (int)GlobalInfo.OptionsWindow.numericUpDownMaximumWidth.Value; else NewWindow.Width = Idx; NewWindow.Height = 400; ChartArea CurrentChartArea = new ChartArea(); CurrentChartArea.BorderColor = Color.Black; CurrentChartArea.CursorX.IsUserSelectionEnabled = true; NewWindow.chartForSimpleForm.ChartAreas.Add(CurrentChartArea); NewWindow.chartForSimpleForm.TextAntiAliasingQuality = TextAntiAliasingQuality.High; CurrentChartArea.BackColor = Color.FromArgb(164, 164, 164); CurrentChartArea.Axes[1].Title = CompleteScreening.ListDescriptors[comboBoxDescriptorToDisplay.SelectedIndex].GetName(); CurrentChartArea.Axes[0].Title = "Index"; CurrentChartArea.Axes[0].MajorGrid.Enabled = false; CurrentSeries.ChartType = SeriesChartType.Point; if (GlobalInfo.OptionsWindow.checkBoxDisplayFastPerformance.Checked) CurrentSeries.ChartType = SeriesChartType.FastPoint; NewWindow.chartForSimpleForm.Series.Add(CurrentSeries); double Av = NewWindow.chartForSimpleForm.DataManipulator.Statistics.Mean("ScatterPoints"); double Std = Math.Sqrt(NewWindow.chartForSimpleForm.DataManipulator.Statistics.Variance("ScatterPoints", true)); StripLine StdLine = new StripLine(); StdLine.BackColor = Color.FromArgb(64, Color.BlanchedAlmond); StdLine.IntervalOffset = Av - 1.5 * Std; StdLine.StripWidth = 3 * Std; CurrentChartArea.AxisY.StripLines.Add(StdLine); StripLine AverageLine = new StripLine(); AverageLine.BackColor = Color.Red; AverageLine.IntervalOffset = Av; AverageLine.StripWidth = 0.0001; AverageLine.Text = String.Format("{0:0.###}", Av); CurrentChartArea.AxisY.StripLines.Add(AverageLine); NewWindow.Text = "Scatter Point / " + Idx + " points"; NewWindow.Show(); NewWindow.chartForSimpleForm.Update(); NewWindow.chartForSimpleForm.Show(); NewWindow.Controls.AddRange(new System.Windows.Forms.Control[] { NewWindow.chartForSimpleForm }); return; }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); System.Windows.Forms.DataVisualization.Charting.StripLine stripLine1 = new System.Windows.Forms.DataVisualization.Charting.StripLine(); System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend(); System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series(); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint1 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(1, 400); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint2 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(2, 200); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint3 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(3, 700); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint4 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(4, 300); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint5 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(5, 450); System.Windows.Forms.DataVisualization.Charting.Series series2 = new System.Windows.Forms.DataVisualization.Charting.Series(); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint6 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(1, 200); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint7 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(2, 300); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint8 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(3, 350); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint9 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(4, 80); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint10 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(5, 400); System.Windows.Forms.DataVisualization.Charting.Series series3 = new System.Windows.Forms.DataVisualization.Charting.Series(); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint11 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(1, 500); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint12 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(2, 120); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint13 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(3, 300); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint14 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(4, 50); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint15 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(5, 130); this.TheFont = new System.Windows.Forms.ComboBox(); this.FontColorCombo = new System.Windows.Forms.ComboBox(); this.TitlePosition = new System.Windows.Forms.ComboBox(); this.FontSize = new System.Windows.Forms.ComboBox(); this.label5 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label(); this.label8 = new System.Windows.Forms.Label(); this.label9 = new System.Windows.Forms.Label(); this.panel1 = new System.Windows.Forms.Panel(); this.label2 = new System.Windows.Forms.Label(); this.TitleLinePosition = new System.Windows.Forms.ComboBox(); this.label1 = new System.Windows.Forms.Label(); this.StrikeoutCheck = new System.Windows.Forms.CheckBox(); this.UnderlineCheck = new System.Windows.Forms.CheckBox(); this.BoldCheck = new System.Windows.Forms.CheckBox(); this.Title = new System.Windows.Forms.TextBox(); this.ItalicCheck = new System.Windows.Forms.CheckBox(); this.AntiAliasingCheck = new System.Windows.Forms.CheckBox(); this.Chart1 = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.Chart1)).BeginInit(); this.SuspendLayout(); // // TheFont // this.TheFont.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.TheFont.Location = new System.Drawing.Point(168, 104); this.TheFont.Name = "TheFont"; this.TheFont.Size = new System.Drawing.Size(116, 22); this.TheFont.TabIndex = 7; this.TheFont.SelectedIndexChanged += new System.EventHandler(this.ControlChange); // // FontColorCombo // this.FontColorCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.FontColorCombo.Location = new System.Drawing.Point(168, 168); this.FontColorCombo.Name = "FontColorCombo"; this.FontColorCombo.Size = new System.Drawing.Size(116, 22); this.FontColorCombo.TabIndex = 11; this.FontColorCombo.SelectedIndexChanged += new System.EventHandler(this.ControlChange); // // TitlePosition // this.TitlePosition.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.TitlePosition.Location = new System.Drawing.Point(168, 40); this.TitlePosition.Name = "TitlePosition"; this.TitlePosition.Size = new System.Drawing.Size(116, 22); this.TitlePosition.TabIndex = 3; this.TitlePosition.SelectedIndexChanged += new System.EventHandler(this.ControlChange); // // FontSize // this.FontSize.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.FontSize.Items.AddRange(new object[] { "8", "10", "12", "14", "16" }); this.FontSize.Location = new System.Drawing.Point(168, 136); this.FontSize.Name = "FontSize"; this.FontSize.Size = new System.Drawing.Size(116, 22); this.FontSize.TabIndex = 9; this.FontSize.SelectedIndexChanged += new System.EventHandler(this.ControlChange); // // label5 // this.label5.Location = new System.Drawing.Point(20, 107); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(144, 16); this.label5.TabIndex = 6; this.label5.Text = "&Font:"; this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label6 // this.label6.Location = new System.Drawing.Point(20, 43); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(144, 16); this.label6.TabIndex = 2; this.label6.Text = "Horizontal &Alignment:"; this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label7 // this.label7.Location = new System.Drawing.Point(20, 171); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(144, 16); this.label7.TabIndex = 10; this.label7.Text = "Font &Color:"; this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label8 // this.label8.Location = new System.Drawing.Point(20, 139); this.label8.Name = "label8"; this.label8.Size = new System.Drawing.Size(144, 16); this.label8.TabIndex = 8; this.label8.Text = "Font &Size:"; this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label9 // this.label9.Font = new System.Drawing.Font("Verdana", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label9.Location = new System.Drawing.Point(16, 8); this.label9.Name = "label9"; this.label9.Size = new System.Drawing.Size(702, 34); this.label9.TabIndex = 0; this.label9.Text = "This sample demonstrates how to set a StripLine object\'s title."; this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // panel1 // this.panel1.Controls.Add(this.label2); this.panel1.Controls.Add(this.TitleLinePosition); this.panel1.Controls.Add(this.label1); this.panel1.Controls.Add(this.StrikeoutCheck); this.panel1.Controls.Add(this.UnderlineCheck); this.panel1.Controls.Add(this.BoldCheck); this.panel1.Controls.Add(this.Title); this.panel1.Controls.Add(this.ItalicCheck); this.panel1.Controls.Add(this.TitlePosition); this.panel1.Controls.Add(this.label5); this.panel1.Controls.Add(this.label6); this.panel1.Controls.Add(this.TheFont); this.panel1.Controls.Add(this.label7); this.panel1.Controls.Add(this.label8); this.panel1.Controls.Add(this.FontSize); this.panel1.Controls.Add(this.FontColorCombo); this.panel1.Controls.Add(this.AntiAliasingCheck); this.panel1.Location = new System.Drawing.Point(432, 56); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(292, 360); this.panel1.TabIndex = 2; // // label2 // this.label2.Location = new System.Drawing.Point(20, 7); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(144, 16); this.label2.TabIndex = 0; this.label2.Text = "Title &Text:"; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // TitleLinePosition // this.TitleLinePosition.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.TitleLinePosition.Location = new System.Drawing.Point(168, 72); this.TitleLinePosition.Name = "TitleLinePosition"; this.TitleLinePosition.Size = new System.Drawing.Size(116, 22); this.TitleLinePosition.TabIndex = 5; this.TitleLinePosition.SelectedIndexChanged += new System.EventHandler(this.ControlChange); // // label1 // this.label1.Location = new System.Drawing.Point(20, 75); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(144, 16); this.label1.TabIndex = 4; this.label1.Text = "&Vertical Alignment:"; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // StrikeoutCheck // this.StrikeoutCheck.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; this.StrikeoutCheck.Location = new System.Drawing.Point(19, 296); this.StrikeoutCheck.Name = "StrikeoutCheck"; this.StrikeoutCheck.Size = new System.Drawing.Size(162, 24); this.StrikeoutCheck.TabIndex = 15; this.StrikeoutCheck.Text = "S&trikeout:"; this.StrikeoutCheck.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.StrikeoutCheck.CheckedChanged += new System.EventHandler(this.ControlChange); // // UnderlineCheck // this.UnderlineCheck.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; this.UnderlineCheck.Location = new System.Drawing.Point(19, 264); this.UnderlineCheck.Name = "UnderlineCheck"; this.UnderlineCheck.Size = new System.Drawing.Size(162, 24); this.UnderlineCheck.TabIndex = 14; this.UnderlineCheck.Text = "&Underline:"; this.UnderlineCheck.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.UnderlineCheck.CheckedChanged += new System.EventHandler(this.ControlChange); // // BoldCheck // this.BoldCheck.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; this.BoldCheck.Location = new System.Drawing.Point(19, 232); this.BoldCheck.Name = "BoldCheck"; this.BoldCheck.Size = new System.Drawing.Size(162, 24); this.BoldCheck.TabIndex = 13; this.BoldCheck.Text = "&Bold:"; this.BoldCheck.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.BoldCheck.CheckedChanged += new System.EventHandler(this.ControlChange); // // Title // this.Title.Location = new System.Drawing.Point(168, 4); this.Title.Name = "Title"; this.Title.Size = new System.Drawing.Size(116, 22); this.Title.TabIndex = 1; this.Title.Text = "Strip Line Title"; this.Title.TextChanged += new System.EventHandler(this.ControlChange); // // ItalicCheck // this.ItalicCheck.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; this.ItalicCheck.Location = new System.Drawing.Point(19, 200); this.ItalicCheck.Name = "ItalicCheck"; this.ItalicCheck.Size = new System.Drawing.Size(162, 24); this.ItalicCheck.TabIndex = 12; this.ItalicCheck.Text = "&Italic:"; this.ItalicCheck.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.ItalicCheck.CheckedChanged += new System.EventHandler(this.ControlChange); // // AntiAliasingCheck // this.AntiAliasingCheck.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; this.AntiAliasingCheck.Checked = true; this.AntiAliasingCheck.CheckState = System.Windows.Forms.CheckState.Checked; this.AntiAliasingCheck.Location = new System.Drawing.Point(16, 328); this.AntiAliasingCheck.Name = "AntiAliasingCheck"; this.AntiAliasingCheck.Size = new System.Drawing.Size(162, 24); this.AntiAliasingCheck.TabIndex = 16; this.AntiAliasingCheck.Text = "Anti Alia&sing:"; this.AntiAliasingCheck.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.AntiAliasingCheck.CheckedChanged += new System.EventHandler(this.ControlChange); // // Chart1 // this.Chart1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(243)))), ((int)(((byte)(223)))), ((int)(((byte)(193))))); this.Chart1.BackGradientStyle = System.Windows.Forms.DataVisualization.Charting.GradientStyle.TopBottom; this.Chart1.BorderlineColor = System.Drawing.Color.FromArgb(((int)(((byte)(181)))), ((int)(((byte)(64)))), ((int)(((byte)(1))))); this.Chart1.BorderlineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Solid; this.Chart1.BorderlineWidth = 2; this.Chart1.BorderSkin.SkinStyle = System.Windows.Forms.DataVisualization.Charting.BorderSkinStyle.Emboss; chartArea1.Area3DStyle.Inclination = 15; chartArea1.Area3DStyle.IsClustered = true; chartArea1.Area3DStyle.IsRightAngleAxes = false; chartArea1.Area3DStyle.Perspective = 10; chartArea1.Area3DStyle.PointGapDepth = 0; chartArea1.Area3DStyle.Rotation = 5; chartArea1.Area3DStyle.WallWidth = 0; chartArea1.AxisX.IsLabelAutoFit = false; chartArea1.AxisX.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); chartArea1.AxisX.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisX.MajorGrid.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); stripLine1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(191)))), ((int)(((byte)(191)))), ((int)(((byte)(191))))); stripLine1.Interval = 3; stripLine1.IntervalOffset = 0.5; stripLine1.StripWidth = 2; chartArea1.AxisX.StripLines.Add(stripLine1); chartArea1.AxisX2.MajorGrid.Enabled = false; chartArea1.AxisY.IsLabelAutoFit = false; chartArea1.AxisY.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); chartArea1.AxisY.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisY.MajorGrid.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisY2.MajorGrid.Enabled = false; chartArea1.BackColor = System.Drawing.Color.OldLace; chartArea1.BackGradientStyle = System.Windows.Forms.DataVisualization.Charting.GradientStyle.TopBottom; chartArea1.BackSecondaryColor = System.Drawing.Color.White; chartArea1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.Name = "Default"; chartArea1.ShadowColor = System.Drawing.Color.Transparent; this.Chart1.ChartAreas.Add(chartArea1); legend1.BackColor = System.Drawing.Color.Transparent; legend1.Enabled = false; legend1.Name = "Default"; this.Chart1.Legends.Add(legend1); this.Chart1.Location = new System.Drawing.Point(16, 48); this.Chart1.Name = "Chart1"; series1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(180)))), ((int)(((byte)(26)))), ((int)(((byte)(59)))), ((int)(((byte)(105))))); series1.BorderWidth = 3; series1.ChartArea = "Default"; series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; series1.Legend = "Default"; series1.Name = "Default"; series1.Points.Add(dataPoint1); series1.Points.Add(dataPoint2); series1.Points.Add(dataPoint3); series1.Points.Add(dataPoint4); series1.Points.Add(dataPoint5); series1.ShadowColor = System.Drawing.Color.Transparent; series1.XValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.Double; series1.YValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.Double; series2.BorderWidth = 3; series2.ChartArea = "Default"; series2.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; series2.Legend = "Default"; series2.Name = "Series2"; series2.Points.Add(dataPoint6); series2.Points.Add(dataPoint7); series2.Points.Add(dataPoint8); series2.Points.Add(dataPoint9); series2.Points.Add(dataPoint10); series3.BorderWidth = 3; series3.ChartArea = "Default"; series3.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; series3.Legend = "Default"; series3.Name = "Series3"; series3.Points.Add(dataPoint11); series3.Points.Add(dataPoint12); series3.Points.Add(dataPoint13); series3.Points.Add(dataPoint14); series3.Points.Add(dataPoint15); this.Chart1.Series.Add(series1); this.Chart1.Series.Add(series2); this.Chart1.Series.Add(series3); this.Chart1.Size = new System.Drawing.Size(412, 296); this.Chart1.TabIndex = 1; // // StripLineTitle // this.Controls.Add(this.Chart1); this.Controls.Add(this.panel1); this.Controls.Add(this.label9); this.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Name = "StripLineTitle"; this.Size = new System.Drawing.Size(728, 480); this.panel1.ResumeLayout(false); this.panel1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.Chart1)).EndInit(); this.ResumeLayout(false); }
private void UpdateChartSettings() { // Get filtering criteria constant double criteriaValue = double.Parse(comboBoxValueMoreThan.Text); // Create strip line which covers the area with filtered values StripLine stripLine = new StripLine(); stripLine.BackColor = Color.FromArgb(120, 241,185,168); stripLine.IntervalOffset = criteriaValue; stripLine.StripWidth = 1000; chart1.ChartAreas["Default"].AxisY.StripLines.Clear(); chart1.ChartAreas["Default"].AxisX.StripLines.Clear(); if(comboBoxPointValueUsed.Text == "Y") { chart1.ChartAreas["Default"].AxisY.StripLines.Add(stripLine); } else { chart1.ChartAreas["Default"].AxisX.StripLines.Add(stripLine); } // Points that do not match the criteria will be removed if(comboBoxCriteriaUsage.Text == "Remove matching points") { chart1.DataManipulator.FilterMatchedPoints = false; // Update the strip line which covers filtered area stripLine.IntervalOffset = 0; stripLine.StripWidth = criteriaValue; } else { chart1.DataManipulator.FilterMatchedPoints = true; } // Filter series data by point's values chart1.DataManipulator.Filter(CompareMethod.MoreThan, criteriaValue, "Series Input", "Series Output", comboBoxPointValueUsed.Text); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); System.Windows.Forms.DataVisualization.Charting.StripLine stripLine1 = new System.Windows.Forms.DataVisualization.Charting.StripLine(); System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend(); System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series(); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint1 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 3); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint2 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 5); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint3 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 4); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint4 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 2); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint5 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 8); System.Windows.Forms.DataVisualization.Charting.Title title1 = new System.Windows.Forms.DataVisualization.Charting.Title(); this.label9 = new System.Windows.Forms.Label(); this.panel1 = new System.Windows.Forms.Panel(); this.label6 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.label15 = new System.Windows.Forms.Label(); this.Chart1 = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.Chart1)).BeginInit(); this.SuspendLayout(); // // label9 // this.label9.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.label9.Font = new System.Drawing.Font("Verdana", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label9.Location = new System.Drawing.Point(16, 14); this.label9.Name = "label9"; this.label9.Size = new System.Drawing.Size(702, 43); this.label9.TabIndex = 0; this.label9.Text = "This sample demonstrates how to use selection to explode a pie slice. To explode " + "a slice, click on the slice or a legend item. "; this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // panel1 // this.panel1.Controls.Add(this.label6); this.panel1.Controls.Add(this.label5); this.panel1.Controls.Add(this.label4); this.panel1.Controls.Add(this.label3); this.panel1.Controls.Add(this.label15); this.panel1.Location = new System.Drawing.Point(432, 73); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(292, 288); this.panel1.TabIndex = 19; // // label6 // this.label6.Location = new System.Drawing.Point(64, 403); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(100, 23); this.label6.TabIndex = 5; this.label6.Text = "Border Size:"; // // label5 // this.label5.Location = new System.Drawing.Point(64, 380); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(100, 23); this.label5.TabIndex = 4; this.label5.Text = "Border Color:"; // // label4 // this.label4.Location = new System.Drawing.Point(64, 357); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(100, 23); this.label4.TabIndex = 3; this.label4.Text = "Hatch Style:"; // // label3 // this.label3.Location = new System.Drawing.Point(64, 334); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(100, 23); this.label3.TabIndex = 2; this.label3.Text = "Gradient:"; // // label15 // this.label15.Location = new System.Drawing.Point(64, 426); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(100, 23); this.label15.TabIndex = 5; this.label15.Text = "Border Size:"; // // Chart1 // this.Chart1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(243)))), ((int)(((byte)(223)))), ((int)(((byte)(193))))); this.Chart1.BackGradientStyle = System.Windows.Forms.DataVisualization.Charting.GradientStyle.TopBottom; this.Chart1.BorderlineColor = System.Drawing.Color.FromArgb(((int)(((byte)(181)))), ((int)(((byte)(64)))), ((int)(((byte)(1))))); this.Chart1.BorderlineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Solid; this.Chart1.BorderlineWidth = 2; this.Chart1.BorderSkin.SkinStyle = System.Windows.Forms.DataVisualization.Charting.BorderSkinStyle.Emboss; chartArea1.Area3DStyle.Inclination = 15; chartArea1.Area3DStyle.IsClustered = true; chartArea1.Area3DStyle.IsRightAngleAxes = false; chartArea1.Area3DStyle.Perspective = 10; chartArea1.Area3DStyle.Rotation = 10; chartArea1.Area3DStyle.WallWidth = 0; chartArea1.AxisX.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); chartArea1.AxisX.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisX.MajorGrid.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisX.ScaleView.Position = 3; chartArea1.AxisX.ScaleView.Size = 30; stripLine1.Interval = 20; stripLine1.StripWidth = 5; chartArea1.AxisX.StripLines.Add(stripLine1); chartArea1.AxisX2.Enabled = System.Windows.Forms.DataVisualization.Charting.AxisEnabled.False; chartArea1.AxisY.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); chartArea1.AxisY.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisY.MajorGrid.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisY.ScaleView.Position = 5; chartArea1.AxisY.ScaleView.Size = 10; chartArea1.AxisY2.Enabled = System.Windows.Forms.DataVisualization.Charting.AxisEnabled.False; chartArea1.BackColor = System.Drawing.Color.Transparent; chartArea1.BackSecondaryColor = System.Drawing.Color.White; chartArea1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.BorderWidth = 0; chartArea1.CursorX.IsUserEnabled = true; chartArea1.CursorX.IsUserSelectionEnabled = true; chartArea1.CursorY.IsUserEnabled = true; chartArea1.CursorY.IsUserSelectionEnabled = true; chartArea1.InnerPlotPosition.Auto = false; chartArea1.InnerPlotPosition.Height = 80F; chartArea1.InnerPlotPosition.Width = 80F; chartArea1.InnerPlotPosition.X = 10F; chartArea1.InnerPlotPosition.Y = 10F; chartArea1.Name = "Default"; chartArea1.Position.Auto = false; chartArea1.Position.Height = 84F; chartArea1.Position.Width = 74F; chartArea1.Position.X = 4.824818F; chartArea1.Position.Y = 12F; chartArea1.ShadowColor = System.Drawing.Color.Transparent; this.Chart1.ChartAreas.Add(chartArea1); legend1.BackColor = System.Drawing.Color.Transparent; legend1.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); legend1.IsTextAutoFit = false; legend1.Name = "Default"; this.Chart1.Legends.Add(legend1); this.Chart1.Location = new System.Drawing.Point(16, 65); this.Chart1.Name = "Chart1"; series1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(180)))), ((int)(((byte)(26)))), ((int)(((byte)(59)))), ((int)(((byte)(105))))); series1.ChartArea = "Default"; series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Pie; series1.CustomProperties = "PieLabelStyle=Disabled"; series1.Legend = "Default"; series1.Name = "Series1"; dataPoint1.AxisLabel = "Product A"; dataPoint2.AxisLabel = "Product B"; dataPoint3.AxisLabel = "Product C"; dataPoint4.AxisLabel = "Product D"; dataPoint5.AxisLabel = "Product E"; series1.Points.Add(dataPoint1); series1.Points.Add(dataPoint2); series1.Points.Add(dataPoint3); series1.Points.Add(dataPoint4); series1.Points.Add(dataPoint5); series1.ShadowOffset = 4; this.Chart1.Series.Add(series1); this.Chart1.Size = new System.Drawing.Size(412, 296); this.Chart1.TabIndex = 0; title1.Font = new System.Drawing.Font("Trebuchet MS", 14.25F, System.Drawing.FontStyle.Bold); title1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(26)))), ((int)(((byte)(59)))), ((int)(((byte)(105))))); title1.Name = "Title1"; title1.ShadowColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); title1.ShadowOffset = 3; title1.Text = "Select a Slice of the Pie"; this.Chart1.Titles.Add(title1); this.Chart1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Chart1_MouseMove); this.Chart1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Chart1_MouseDown); this.Chart1.Click += new System.EventHandler(this.Chart1_Click); // // InteractivePie // this.BackColor = System.Drawing.Color.White; this.Controls.Add(this.Chart1); this.Controls.Add(this.panel1); this.Controls.Add(this.label9); this.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Name = "InteractivePie"; this.Size = new System.Drawing.Size(728, 368); this.panel1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.Chart1)).EndInit(); this.ResumeLayout(false); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); System.Windows.Forms.DataVisualization.Charting.StripLine stripLine1 = new System.Windows.Forms.DataVisualization.Charting.StripLine(); System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend(); System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series(); this.StripWidth = new System.Windows.Forms.ComboBox(); this.IntervalOffset = new System.Windows.Forms.ComboBox(); this.IntervalType = new System.Windows.Forms.ComboBox(); this.IntervalOffsetType = new System.Windows.Forms.ComboBox(); this.label5 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label(); this.label8 = new System.Windows.Forms.Label(); this.label9 = new System.Windows.Forms.Label(); this.panel1 = new System.Windows.Forms.Panel(); this.label2 = new System.Windows.Forms.Label(); this.StripWidthType = new System.Windows.Forms.ComboBox(); this.label1 = new System.Windows.Forms.Label(); this.StripInterval = new System.Windows.Forms.ComboBox(); this.Chart1 = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.Chart1)).BeginInit(); this.SuspendLayout(); // // StripWidth // this.StripWidth.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.StripWidth.Items.AddRange(new object[] { "0", "1", "2"}); this.StripWidth.Location = new System.Drawing.Point(168, 136); this.StripWidth.Name = "StripWidth"; this.StripWidth.Size = new System.Drawing.Size(121, 22); this.StripWidth.TabIndex = 4; this.StripWidth.SelectedIndexChanged += new System.EventHandler(this.ControlSelectedIndexChanged); // // IntervalOffset // this.IntervalOffset.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.IntervalOffset.Items.AddRange(new object[] { "1", "2"}); this.IntervalOffset.Location = new System.Drawing.Point(168, 72); this.IntervalOffset.Name = "IntervalOffset"; this.IntervalOffset.Size = new System.Drawing.Size(121, 22); this.IntervalOffset.TabIndex = 2; this.IntervalOffset.SelectedIndexChanged += new System.EventHandler(this.ControlSelectedIndexChanged); // // IntervalType // this.IntervalType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.IntervalType.Items.AddRange(new object[] { "Weeks", "Months"}); this.IntervalType.Location = new System.Drawing.Point(168, 40); this.IntervalType.Name = "IntervalType"; this.IntervalType.Size = new System.Drawing.Size(121, 22); this.IntervalType.TabIndex = 1; this.IntervalType.SelectedIndexChanged += new System.EventHandler(this.ControlSelectedIndexChanged); // // IntervalOffsetType // this.IntervalOffsetType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.IntervalOffsetType.Items.AddRange(new object[] { "Days", "Weeks"}); this.IntervalOffsetType.Location = new System.Drawing.Point(168, 104); this.IntervalOffsetType.Name = "IntervalOffsetType"; this.IntervalOffsetType.Size = new System.Drawing.Size(121, 22); this.IntervalOffsetType.TabIndex = 3; this.IntervalOffsetType.SelectedIndexChanged += new System.EventHandler(this.ControlSelectedIndexChanged); // // label5 // this.label5.Location = new System.Drawing.Point(14, 139); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(152, 16); this.label5.TabIndex = 13; this.label5.Text = "Strip &Width:"; this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label6 // this.label6.Location = new System.Drawing.Point(14, 43); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(152, 16); this.label6.TabIndex = 14; this.label6.Text = "Interval &Type:"; this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label7 // this.label7.Location = new System.Drawing.Point(14, 75); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(152, 16); this.label7.TabIndex = 15; this.label7.Text = "&Offset:"; this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label8 // this.label8.Location = new System.Drawing.Point(14, 107); this.label8.Name = "label8"; this.label8.Size = new System.Drawing.Size(152, 16); this.label8.TabIndex = 16; this.label8.Text = "Offset T&ype:"; this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label9 // this.label9.Font = new System.Drawing.Font("Verdana", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label9.Location = new System.Drawing.Point(16, 14); this.label9.Name = "label9"; this.label9.Size = new System.Drawing.Size(702, 43); this.label9.TabIndex = 2; this.label9.Text = "This sample demonstrates how to set the offset, interval, strip width, and width " + "type of a StripLine object."; this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // panel1 // this.panel1.Controls.Add(this.label2); this.panel1.Controls.Add(this.StripWidthType); this.panel1.Controls.Add(this.label1); this.panel1.Controls.Add(this.StripInterval); this.panel1.Controls.Add(this.IntervalType); this.panel1.Controls.Add(this.label5); this.panel1.Controls.Add(this.label6); this.panel1.Controls.Add(this.StripWidth); this.panel1.Controls.Add(this.label7); this.panel1.Controls.Add(this.label8); this.panel1.Controls.Add(this.IntervalOffsetType); this.panel1.Controls.Add(this.IntervalOffset); this.panel1.Location = new System.Drawing.Point(432, 73); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(292, 288); this.panel1.TabIndex = 0; // // label2 // this.label2.Location = new System.Drawing.Point(14, 171); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(152, 16); this.label2.TabIndex = 28; this.label2.Text = "Width Ty&pe:"; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // StripWidthType // this.StripWidthType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.StripWidthType.Items.AddRange(new object[] { "Days", "Weeks"}); this.StripWidthType.Location = new System.Drawing.Point(168, 168); this.StripWidthType.Name = "StripWidthType"; this.StripWidthType.Size = new System.Drawing.Size(121, 22); this.StripWidthType.TabIndex = 5; this.StripWidthType.SelectedIndexChanged += new System.EventHandler(this.ControlSelectedIndexChanged); // // label1 // this.label1.Location = new System.Drawing.Point(14, 11); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(152, 16); this.label1.TabIndex = 18; this.label1.Text = "&Interval:"; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // StripInterval // this.StripInterval.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.StripInterval.Items.AddRange(new object[] { "1", "2", "3"}); this.StripInterval.Location = new System.Drawing.Point(168, 8); this.StripInterval.Name = "StripInterval"; this.StripInterval.Size = new System.Drawing.Size(121, 22); this.StripInterval.TabIndex = 0; this.StripInterval.SelectedIndexChanged += new System.EventHandler(this.ControlSelectedIndexChanged); // // Chart1 // this.Chart1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(243)))), ((int)(((byte)(223)))), ((int)(((byte)(193))))); this.Chart1.BackGradientStyle = System.Windows.Forms.DataVisualization.Charting.GradientStyle.TopBottom; this.Chart1.BorderlineColor = System.Drawing.Color.FromArgb(((int)(((byte)(181)))), ((int)(((byte)(64)))), ((int)(((byte)(1))))); this.Chart1.BorderlineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Solid; this.Chart1.BorderlineWidth = 2; this.Chart1.BorderSkin.SkinStyle = System.Windows.Forms.DataVisualization.Charting.BorderSkinStyle.Emboss; chartArea1.Area3DStyle.Inclination = 15; chartArea1.Area3DStyle.IsClustered = true; chartArea1.Area3DStyle.IsRightAngleAxes = false; chartArea1.Area3DStyle.Perspective = 10; chartArea1.Area3DStyle.Rotation = 10; chartArea1.Area3DStyle.WallWidth = 0; chartArea1.AxisX.IsLabelAutoFit = false; chartArea1.AxisX.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); chartArea1.AxisX.LabelStyle.Format = "d MMM"; chartArea1.AxisX.LabelStyle.IsStaggered = true; chartArea1.AxisX.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisX.MajorGrid.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); stripLine1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(241)))), ((int)(((byte)(185)))), ((int)(((byte)(168))))); stripLine1.Interval = 2; stripLine1.StripWidth = 1; chartArea1.AxisX.StripLines.Add(stripLine1); chartArea1.AxisY.IsLabelAutoFit = false; chartArea1.AxisY.IsStartedFromZero = false; chartArea1.AxisY.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); chartArea1.AxisY.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisY.MajorGrid.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisY2.MajorGrid.Enabled = false; chartArea1.BackColor = System.Drawing.Color.OldLace; chartArea1.BackGradientStyle = System.Windows.Forms.DataVisualization.Charting.GradientStyle.TopBottom; chartArea1.BackSecondaryColor = System.Drawing.Color.White; chartArea1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.Name = "Default"; chartArea1.ShadowColor = System.Drawing.Color.Transparent; this.Chart1.ChartAreas.Add(chartArea1); legend1.BackColor = System.Drawing.Color.Transparent; legend1.Enabled = false; legend1.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); legend1.IsTextAutoFit = false; legend1.Name = "Default"; this.Chart1.Legends.Add(legend1); this.Chart1.Location = new System.Drawing.Point(16, 65); this.Chart1.Name = "Chart1"; series1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(180)))), ((int)(((byte)(26)))), ((int)(((byte)(59)))), ((int)(((byte)(105))))); series1.ChartArea = "Default"; series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Stock; series1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(140)))), ((int)(((byte)(240))))); series1.Legend = "Default"; series1.Name = "Default"; series1.ShadowOffset = 1; series1.YValuesPerPoint = 4; this.Chart1.Series.Add(series1); this.Chart1.Size = new System.Drawing.Size(412, 296); this.Chart1.TabIndex = 1; // // StripIntervals // this.Controls.Add(this.Chart1); this.Controls.Add(this.panel1); this.Controls.Add(this.label9); this.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Name = "StripIntervals"; this.Size = new System.Drawing.Size(728, 480); this.Load += new System.EventHandler(this.StripIntervals_Load); this.panel1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.Chart1)).EndInit(); this.ResumeLayout(false); }
private void DisplayHisto(object sender, EventArgs e) { if ((Parent.ListDescriptors == null) || (Parent.ListDescriptors.Count == 0)) return; cExtendedList Pos = new cExtendedList(); cWell TempWell; int NumberOfPlates = Parent.GlobalInfo.PlateListWindow.listBoxPlateNameToProcess.Items.Count; // loop on all the plate for (int PlateIdx = 0; PlateIdx < NumberOfPlates; PlateIdx++) { cPlate CurrentPlateToProcess = Parent.ListPlatesActive.GetPlate((string)Parent.GlobalInfo.PlateListWindow.listBoxPlateNameToProcess.Items[PlateIdx]); for (int row = 0; row < Parent.Rows; row++) for (int col = 0; col < Parent.Columns; col++) { TempWell = CurrentPlateToProcess.GetWell(col, row, false); if (TempWell == null) continue; else { if (TempWell.GetClass() == this.ClassForClassif) Pos.Add(TempWell.ListDescriptors[Parent.ListDescriptors.CurrentSelectedDescriptor].GetValue()); } } } if (Pos.Count == 0) { MessageBox.Show("No well of class " + Parent.SelectedClass + " selected !", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } List<double[]> HistoPos = Pos.CreateHistogram((int)Parent.GlobalInfo.OptionsWindow.numericUpDownHistoBin.Value); if (HistoPos == null) return; SimpleForm NewWindow = new SimpleForm(); Series SeriesPos = new Series(); SeriesPos.ShadowOffset = 1; if (HistoPos.Count == 0) return; for (int IdxValue = 0; IdxValue < HistoPos[0].Length; IdxValue++) { SeriesPos.Points.AddXY(HistoPos[0][IdxValue], HistoPos[1][IdxValue]); SeriesPos.Points[IdxValue].ToolTip = HistoPos[1][IdxValue].ToString(); if (this.ClassForClassif == -1) SeriesPos.Points[IdxValue].Color = Color.Black; else SeriesPos.Points[IdxValue].Color = Parent.GlobalInfo.GetColor(this.ClassForClassif); } ChartArea CurrentChartArea = new ChartArea(); CurrentChartArea.BorderColor = Color.Black; NewWindow.chartForSimpleForm.ChartAreas.Add(CurrentChartArea); CurrentChartArea.Axes[0].MajorGrid.Enabled = false; CurrentChartArea.Axes[0].Title = Parent.ListDescriptors[Parent.ListDescriptors.CurrentSelectedDescriptor].GetName(); CurrentChartArea.Axes[1].Title = "Sum"; CurrentChartArea.AxisX.LabelStyle.Format = "N2"; NewWindow.chartForSimpleForm.TextAntiAliasingQuality = TextAntiAliasingQuality.High; CurrentChartArea.BackGradientStyle = GradientStyle.TopBottom; CurrentChartArea.BackColor = Parent.GlobalInfo.OptionsWindow.panel1.BackColor; CurrentChartArea.BackSecondaryColor = Color.White; SeriesPos.ChartType = SeriesChartType.Column; // SeriesPos.Color = Parent.GetColor(1); NewWindow.chartForSimpleForm.Series.Add(SeriesPos); NewWindow.chartForSimpleForm.ChartAreas[0].CursorX.IsUserEnabled = true; NewWindow.chartForSimpleForm.ChartAreas[0].CursorX.IsUserSelectionEnabled = true; NewWindow.chartForSimpleForm.ChartAreas[0].AxisX.ScaleView.Zoomable = true; NewWindow.chartForSimpleForm.ChartAreas[0].AxisX.ScrollBar.IsPositionedInside = true; StripLine AverageLine = new StripLine(); AverageLine.BackColor = Color.Red; AverageLine.IntervalOffset = this.ListDescriptors[Parent.ListDescriptors.CurrentSelectedDescriptor].GetValue(); AverageLine.StripWidth = 0.0001; AverageLine.Text = String.Format("{0:0.###}", this.ListDescriptors[Parent.ListDescriptors.CurrentSelectedDescriptor].GetValue()); CurrentChartArea.AxisX.StripLines.Add(AverageLine); if (Parent.GlobalInfo.OptionsWindow.checkBoxDisplayHistoStats.Checked) { StripLine NAverageLine = new StripLine(); NAverageLine.BackColor = Color.Black; NAverageLine.IntervalOffset = Pos.Mean(); NAverageLine.StripWidth = 0.0001;// double.Epsilon; CurrentChartArea.AxisX.StripLines.Add(NAverageLine); NAverageLine.Text = String.Format("{0:0.###}", NAverageLine.IntervalOffset); StripLine StdLine = new StripLine(); StdLine.BackColor = Color.FromArgb(64, Color.Black); double Std = Pos.Std(); StdLine.IntervalOffset = NAverageLine.IntervalOffset - 0.5 * Std; StdLine.StripWidth = Std; CurrentChartArea.AxisX.StripLines.Add(StdLine); //NAverageLine.StripWidth = 0.01; } Title CurrentTitle = new Title(this.StateForClassif + " - " + Parent.ListDescriptors[Parent.ListDescriptors.CurrentSelectedDescriptor].GetName() + " histogram."); CurrentTitle.Font = new System.Drawing.Font("Arial", 11, FontStyle.Bold); NewWindow.chartForSimpleForm.Titles.Add(CurrentTitle); NewWindow.Text = CurrentTitle.Text; NewWindow.Show(); NewWindow.chartForSimpleForm.Update(); NewWindow.chartForSimpleForm.Show(); NewWindow.Controls.AddRange(new System.Windows.Forms.Control[] { NewWindow.chartForSimpleForm }); return; }
public static void AddStripline(this Axis axis, double value) { StripLine stripLine = new StripLine(); stripLine.BorderColor = System.Drawing.Color.Red; stripLine.BorderDashStyle = ChartDashStyle.Dash; stripLine.BorderWidth = 2; stripLine.Interval = 0.0; stripLine.IntervalOffset = value; stripLine.StripWidth = 0.0; axis.StripLines.Add(stripLine); }
/// <summary> /// Ensures thread safety when highlighting multiple maps /// </summary> /// <param name="i">The graph number currently being highlighted.</param> /// <param name="highlightToBeAdded">The highlight to be added.</param> private void AddGraphHighlightAuxilliary(int i, StripLine highlightToBeAdded) { if (this.chartsSensorGraphs[i].InvokeRequired) { SetResponseCallbackHighlight d = new SetResponseCallbackHighlight(this.AddGraphHighlightAuxilliary); this.Invoke(d, new object[] { i, highlightToBeAdded }); } else { this.chartsSensorGraphs[i].ChartAreas[0].AxisX.StripLines.Add(highlightToBeAdded); } }
private void CreateAndAddStripLine(string title, int start, int end, Color color, Color secondColor, ChartHatchStyle hatchStyle = ChartHatchStyle.None) { StripLine stripLine = new StripLine(); stripLine.BackColor = color; stripLine.BackSecondaryColor = secondColor; stripLine.BackHatchStyle = hatchStyle; stripLine.Text = title; stripLine.Font = new Font("Times New Roman", 12, FontStyle.Bold); // strip range is [start .. end] inclusive, but we evaluate [start..end[ (end is exclusive) // the strip should be by one longer (starting at start - 0.5 and ending at end + 0.5) stripLine.StripWidth = end - start; stripLine.IntervalOffset = start - 0.5; // start slightly to the left of the first point to clearly indicate the first point in the partition this.chart.ChartAreas[0].AxisX.StripLines.Add(stripLine); }
public cWindowToDisplayHisto(cScreening CompleteScreening0, cExtendedList RawValues0) { this.CompleteScreening = CompleteScreening0; this.parametersToolStripMenuItem.Click += new System.EventHandler(this.parametersToolStripMenuItem_Click); RequestWindow.label3.Text = "Bin Number"; this.RawValues = RawValues0; CurrentChartArea = new ChartArea(); CurrentChartArea.BorderColor = Color.Black; this.chartForSimpleForm.ChartAreas.Add(CurrentChartArea); CurrentChartArea.Axes[0].MajorGrid.Enabled = false; if(CompleteScreening!=null) CurrentChartArea.Axes[0].Title = CompleteScreening.ListDescriptors[CompleteScreening.ListDescriptors.CurrentSelectedDescriptorIdx].GetName(); CurrentChartArea.Axes[1].Title = "Sum"; CurrentChartArea.AxisX.LabelStyle.Format = "N2"; this.chartForSimpleForm.TextAntiAliasingQuality = TextAntiAliasingQuality.High; if (CompleteScreening != null) CurrentChartArea.BackColor = Color.White; this.chartForSimpleForm.ChartAreas[0].CursorX.IsUserEnabled = true; this.chartForSimpleForm.ChartAreas[0].CursorX.IsUserSelectionEnabled = true; this.chartForSimpleForm.ChartAreas[0].AxisX.ScaleView.Zoomable = true; this.chartForSimpleForm.ChartAreas[0].AxisX.ScrollBar.IsPositionedInside = true; if ((CompleteScreening != null) && (cGlobalInfo.OptionsWindow.FFAllOptions.checkBoxHistoDisplayStats.Checked)) { StripLine AverageLine = new StripLine(); AverageLine.BackColor = Color.Black; AverageLine.IntervalOffset = RawValues.Mean(); AverageLine.StripWidth = double.Epsilon; CurrentChartArea.AxisX.StripLines.Add(AverageLine); AverageLine.Text = String.Format("{0:0.###}", AverageLine.IntervalOffset); StripLine StdLine = new StripLine(); StdLine.BackColor = Color.FromArgb(64, Color.Black); double Std = RawValues.Std(); StdLine.IntervalOffset = AverageLine.IntervalOffset - 0.5 * Std; StdLine.StripWidth = Std; CurrentChartArea.AxisX.StripLines.Add(StdLine); AverageLine.StripWidth = 0.0001; } SerieForHisto = new Series(); SerieForHisto.ShadowOffset = 1; SerieForHisto.ChartType = SeriesChartType.Column; if (CompleteScreening != null) SerieForHisto.Color = cGlobalInfo.ListWellClasses[1].ColourForDisplay; List<double[]> HistoPos = RawValues.CreateHistogram(this.BinNumber, false); if (HistoPos.Count == 0) return; for (int IdxValue = 0; IdxValue < HistoPos[0].Length; IdxValue++) { SerieForHisto.Points.AddXY(HistoPos[0][IdxValue], HistoPos[1][IdxValue]); SerieForHisto.Points[IdxValue].ToolTip = HistoPos[1][IdxValue].ToString(); if (CompleteScreening != null) { if (CompleteScreening.SelectedClass == -1) SerieForHisto.Points[IdxValue].Color = Color.Black; else SerieForHisto.Points[IdxValue].Color = cGlobalInfo.ListWellClasses[CompleteScreening.SelectedClass].ColourForDisplay; } } this.chartForSimpleForm.Series.Add(SerieForHisto); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); System.Windows.Forms.DataVisualization.Charting.StripLine stripLine1 = new System.Windows.Forms.DataVisualization.Charting.StripLine(); System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend(); System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series(); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint1 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 5); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint2 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 9); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint3 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 7); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint4 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 6); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint5 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 3); System.Windows.Forms.DataVisualization.Charting.Title title1 = new System.Windows.Forms.DataVisualization.Charting.Title(); this.label9 = new System.Windows.Forms.Label(); this.panel1 = new System.Windows.Forms.Panel(); this.label6 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.label15 = new System.Windows.Forms.Label(); this.Chart1 = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.Chart1)).BeginInit(); this.SuspendLayout(); // // label9 // this.label9.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.label9.Font = new System.Drawing.Font("Verdana", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label9.Location = new System.Drawing.Point(16, 14); this.label9.Name = "label9"; this.label9.Size = new System.Drawing.Size(702, 39); this.label9.TabIndex = 0; this.label9.Text = "This sample lets you change the value and appearance of a data point. Click on th" + "e data point to display its property dialog."; this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // panel1 // this.panel1.Controls.Add(this.label6); this.panel1.Controls.Add(this.label5); this.panel1.Controls.Add(this.label4); this.panel1.Controls.Add(this.label3); this.panel1.Controls.Add(this.label15); this.panel1.Location = new System.Drawing.Point(432, 69); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(292, 288); this.panel1.TabIndex = 19; // // label6 // this.label6.Location = new System.Drawing.Point(64, 403); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(100, 23); this.label6.TabIndex = 5; this.label6.Text = "Border Size:"; // // label5 // this.label5.Location = new System.Drawing.Point(64, 380); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(100, 23); this.label5.TabIndex = 4; this.label5.Text = "Border Color:"; // // label4 // this.label4.Location = new System.Drawing.Point(64, 357); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(100, 23); this.label4.TabIndex = 3; this.label4.Text = "Hatch Style:"; // // label3 // this.label3.Location = new System.Drawing.Point(64, 334); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(100, 23); this.label3.TabIndex = 2; this.label3.Text = "Gradient:"; // // label15 // this.label15.Location = new System.Drawing.Point(64, 426); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(100, 23); this.label15.TabIndex = 5; this.label15.Text = "Border Size:"; // // Chart1 // this.Chart1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(211)))), ((int)(((byte)(223)))), ((int)(((byte)(240))))); this.Chart1.BackGradientStyle = System.Windows.Forms.DataVisualization.Charting.GradientStyle.TopBottom; this.Chart1.BackSecondaryColor = System.Drawing.Color.White; this.Chart1.BorderlineColor = System.Drawing.Color.FromArgb(((int)(((byte)(26)))), ((int)(((byte)(59)))), ((int)(((byte)(105))))); this.Chart1.BorderlineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Solid; this.Chart1.BorderlineWidth = 2; this.Chart1.BorderSkin.SkinStyle = System.Windows.Forms.DataVisualization.Charting.BorderSkinStyle.Emboss; chartArea1.Area3DStyle.Inclination = 15; chartArea1.Area3DStyle.IsClustered = true; chartArea1.Area3DStyle.IsRightAngleAxes = false; chartArea1.Area3DStyle.Perspective = 10; chartArea1.Area3DStyle.Rotation = 10; chartArea1.Area3DStyle.WallWidth = 0; chartArea1.AxisX.IsLabelAutoFit = false; chartArea1.AxisX.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); chartArea1.AxisX.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisX.MajorGrid.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisX2.Enabled = System.Windows.Forms.DataVisualization.Charting.AxisEnabled.False; chartArea1.AxisY.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); chartArea1.AxisY.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisY.MajorGrid.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); stripLine1.Interval = 4; stripLine1.IntervalOffset = 2; stripLine1.StripWidth = 2; chartArea1.AxisY.StripLines.Add(stripLine1); chartArea1.AxisY2.Enabled = System.Windows.Forms.DataVisualization.Charting.AxisEnabled.False; chartArea1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(165)))), ((int)(((byte)(191)))), ((int)(((byte)(228))))); chartArea1.BackGradientStyle = System.Windows.Forms.DataVisualization.Charting.GradientStyle.TopBottom; chartArea1.BackSecondaryColor = System.Drawing.Color.White; chartArea1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.BorderDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Solid; chartArea1.Name = "Default"; chartArea1.ShadowColor = System.Drawing.Color.Transparent; this.Chart1.ChartAreas.Add(chartArea1); legend1.BackColor = System.Drawing.Color.Transparent; legend1.DockedToChartArea = "Default"; legend1.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); legend1.IsTextAutoFit = false; legend1.Name = "Default"; this.Chart1.Legends.Add(legend1); this.Chart1.Location = new System.Drawing.Point(16, 61); this.Chart1.Name = "Chart1"; series1.BorderColor = System.Drawing.Color.SlateGray; series1.ChartArea = "Default"; series1.Color = System.Drawing.Color.DodgerBlue; series1.Legend = "Default"; series1.MarkerBorderColor = System.Drawing.Color.Black; series1.MarkerColor = System.Drawing.Color.Gold; series1.MarkerSize = 8; series1.MarkerStyle = System.Windows.Forms.DataVisualization.Charting.MarkerStyle.Circle; series1.Name = "Series1"; dataPoint1.Label = "USA"; dataPoint2.Label = "Canada"; dataPoint3.Label = "Spain"; dataPoint4.Label = "France"; dataPoint5.Label = "Italy"; series1.Points.Add(dataPoint1); series1.Points.Add(dataPoint2); series1.Points.Add(dataPoint3); series1.Points.Add(dataPoint4); series1.Points.Add(dataPoint5); series1.ShadowColor = System.Drawing.Color.Black; series1.ShadowOffset = 1; this.Chart1.Series.Add(series1); this.Chart1.Size = new System.Drawing.Size(412, 296); this.Chart1.TabIndex = 0; title1.Font = new System.Drawing.Font("Trebuchet MS", 14.25F, System.Drawing.FontStyle.Bold); title1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(26)))), ((int)(((byte)(59)))), ((int)(((byte)(105))))); title1.Name = "Title1"; title1.ShadowColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); title1.ShadowOffset = 3; title1.Text = "Selection"; this.Chart1.Titles.Add(title1); this.Chart1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Chart1_MouseMove); this.Chart1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Chart1_MouseDown); // // Selection // this.BackColor = System.Drawing.Color.White; this.Controls.Add(this.Chart1); this.Controls.Add(this.panel1); this.Controls.Add(this.label9); this.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Name = "Selection"; this.Size = new System.Drawing.Size(728, 352); this.panel1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.Chart1)).EndInit(); this.ResumeLayout(false); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); System.Windows.Forms.DataVisualization.Charting.StripLine stripLine1 = new System.Windows.Forms.DataVisualization.Charting.StripLine(); System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend(); System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series(); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint1 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 700); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint2 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 400); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint3 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 200); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint4 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 450); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint5 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 300); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint6 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 245); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint7 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 568); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint8 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 345); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint9 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 789); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint10 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 834); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint11 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 382); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint12 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 599); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint13 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 123); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint14 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 223); System.Windows.Forms.DataVisualization.Charting.Title title1 = new System.Windows.Forms.DataVisualization.Charting.Title(); this.StripEndColor = new System.Windows.Forms.ComboBox(); this.StripColor = new System.Windows.Forms.ComboBox(); this.HatchStyle = new System.Windows.Forms.ComboBox(); this.Gradient = new System.Windows.Forms.ComboBox(); this.LineColor = new System.Windows.Forms.ComboBox(); this.StripLinesStyle = new System.Windows.Forms.ComboBox(); this.LineWidth = new System.Windows.Forms.ComboBox(); this.label2 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label(); this.label9 = new System.Windows.Forms.Label(); this.panel1 = new System.Windows.Forms.Panel(); this.label1 = new System.Windows.Forms.Label(); this.Interval = new System.Windows.Forms.ComboBox(); this.label11 = new System.Windows.Forms.Label(); this.Chart1 = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.label10 = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.Chart1)).BeginInit(); this.SuspendLayout(); // // StripEndColor // this.StripEndColor.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.StripEndColor.Items.AddRange(new object[] { "DarkRed", "Green", "Yellow", "SlateGray", "Gold"}); this.StripEndColor.Location = new System.Drawing.Point(168, 120); this.StripEndColor.Name = "StripEndColor"; this.StripEndColor.Size = new System.Drawing.Size(121, 22); this.StripEndColor.TabIndex = 9; this.StripEndColor.SelectedIndexChanged += new System.EventHandler(this.ControlChanged); // // StripColor // this.StripColor.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.StripColor.Items.AddRange(new object[] { "Red", "Gainsboro", "Khaki", "LightSteelBlue"}); this.StripColor.Location = new System.Drawing.Point(168, 48); this.StripColor.Name = "StripColor"; this.StripColor.Size = new System.Drawing.Size(121, 22); this.StripColor.TabIndex = 3; this.StripColor.SelectedIndexChanged += new System.EventHandler(this.ControlChanged); // // HatchStyle // this.HatchStyle.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.HatchStyle.Location = new System.Drawing.Point(168, 96); this.HatchStyle.Name = "HatchStyle"; this.HatchStyle.Size = new System.Drawing.Size(121, 22); this.HatchStyle.TabIndex = 7; this.HatchStyle.SelectedIndexChanged += new System.EventHandler(this.HatchControlChanged); // // Gradient // this.Gradient.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.Gradient.Location = new System.Drawing.Point(168, 72); this.Gradient.Name = "Gradient"; this.Gradient.Size = new System.Drawing.Size(121, 22); this.Gradient.TabIndex = 5; this.Gradient.SelectedIndexChanged += new System.EventHandler(this.GradienControlChanged); // // LineColor // this.LineColor.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.LineColor.Items.AddRange(new object[] { "MidnightBlue", "Green", "Black", "Red"}); this.LineColor.Location = new System.Drawing.Point(168, 184); this.LineColor.Name = "LineColor"; this.LineColor.Size = new System.Drawing.Size(121, 22); this.LineColor.TabIndex = 13; this.LineColor.SelectedIndexChanged += new System.EventHandler(this.ControlChanged); // // StripLinesStyle // this.StripLinesStyle.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.StripLinesStyle.Location = new System.Drawing.Point(168, 160); this.StripLinesStyle.Name = "StripLinesStyle"; this.StripLinesStyle.Size = new System.Drawing.Size(121, 22); this.StripLinesStyle.TabIndex = 11; this.StripLinesStyle.SelectedIndexChanged += new System.EventHandler(this.ControlChanged); // // LineWidth // this.LineWidth.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.LineWidth.Items.AddRange(new object[] { "1", "2", "3", "4", "5"}); this.LineWidth.Location = new System.Drawing.Point(168, 208); this.LineWidth.Name = "LineWidth"; this.LineWidth.Size = new System.Drawing.Size(121, 22); this.LineWidth.TabIndex = 15; this.LineWidth.SelectedIndexChanged += new System.EventHandler(this.ControlChanged); // // label2 // this.label2.Location = new System.Drawing.Point(20, 50); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(148, 16); this.label2.TabIndex = 2; this.label2.Text = "Back &Color:"; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label3 // this.label3.Location = new System.Drawing.Point(20, 122); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(148, 16); this.label3.TabIndex = 8; this.label3.Text = "S&econdary Back Color:"; this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label4 // this.label4.Location = new System.Drawing.Point(20, 74); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(148, 16); this.label4.TabIndex = 4; this.label4.Text = "&Gradient Style:"; this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label5 // this.label5.Location = new System.Drawing.Point(20, 98); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(148, 16); this.label5.TabIndex = 6; this.label5.Text = "&Hatch Style:"; this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label6 // this.label6.Location = new System.Drawing.Point(19, 162); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(148, 16); this.label6.TabIndex = 10; this.label6.Text = "Border &Style:"; this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label7 // this.label7.Location = new System.Drawing.Point(18, 186); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(148, 16); this.label7.TabIndex = 12; this.label7.Text = "&Border Color:"; this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label9 // this.label9.Font = new System.Drawing.Font("Verdana", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label9.Location = new System.Drawing.Point(16, 8); this.label9.Name = "label9"; this.label9.Size = new System.Drawing.Size(702, 34); this.label9.TabIndex = 0; this.label9.Text = "This sample demonstrates how to set the appearance properties of the StripLine ob" + "ject."; this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // panel1 // this.panel1.Controls.Add(this.label1); this.panel1.Controls.Add(this.Interval); this.panel1.Controls.Add(this.StripLinesStyle); this.panel1.Controls.Add(this.label5); this.panel1.Controls.Add(this.Gradient); this.panel1.Controls.Add(this.label6); this.panel1.Controls.Add(this.label4); this.panel1.Controls.Add(this.HatchStyle); this.panel1.Controls.Add(this.label7); this.panel1.Controls.Add(this.label3); this.panel1.Controls.Add(this.label2); this.panel1.Controls.Add(this.LineWidth); this.panel1.Controls.Add(this.StripEndColor); this.panel1.Controls.Add(this.StripColor); this.panel1.Controls.Add(this.LineColor); this.panel1.Controls.Add(this.label11); this.panel1.Location = new System.Drawing.Point(432, 56); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(292, 296); this.panel1.TabIndex = 2; // // label1 // this.label1.Location = new System.Drawing.Point(20, 11); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(148, 16); this.label1.TabIndex = 0; this.label1.Text = "Strip &Interval:"; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // Interval // this.Interval.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.Interval.Items.AddRange(new object[] { "2", "3", "4", "5"}); this.Interval.Location = new System.Drawing.Point(168, 8); this.Interval.Name = "Interval"; this.Interval.Size = new System.Drawing.Size(121, 22); this.Interval.TabIndex = 1; this.Interval.SelectedIndexChanged += new System.EventHandler(this.ControlChanged); // // label11 // this.label11.Location = new System.Drawing.Point(18, 211); this.label11.Name = "label11"; this.label11.Size = new System.Drawing.Size(148, 16); this.label11.TabIndex = 14; this.label11.Text = "Border Si&ze:"; this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // Chart1 // this.Chart1.BackColor = System.Drawing.Color.WhiteSmoke; this.Chart1.BackGradientStyle = System.Windows.Forms.DataVisualization.Charting.GradientStyle.TopBottom; this.Chart1.BackSecondaryColor = System.Drawing.Color.White; this.Chart1.BorderlineColor = System.Drawing.Color.FromArgb(((int)(((byte)(26)))), ((int)(((byte)(59)))), ((int)(((byte)(105))))); this.Chart1.BorderlineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Solid; this.Chart1.BorderlineWidth = 2; this.Chart1.BorderSkin.SkinStyle = System.Windows.Forms.DataVisualization.Charting.BorderSkinStyle.Emboss; chartArea1.Area3DStyle.Inclination = 15; chartArea1.Area3DStyle.IsClustered = true; chartArea1.Area3DStyle.IsRightAngleAxes = false; chartArea1.Area3DStyle.Perspective = 10; chartArea1.Area3DStyle.Rotation = 10; chartArea1.Area3DStyle.WallWidth = 0; chartArea1.AxisX.IsLabelAutoFit = false; chartArea1.AxisX.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); chartArea1.AxisX.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisX.MajorGrid.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); stripLine1.BackColor = System.Drawing.Color.Gainsboro; stripLine1.Interval = 2; stripLine1.IntervalOffset = 0.5; stripLine1.StripWidth = 1; chartArea1.AxisX.StripLines.Add(stripLine1); chartArea1.AxisY.IsLabelAutoFit = false; chartArea1.AxisY.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); chartArea1.AxisY.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisY.MajorGrid.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.BackColor = System.Drawing.Color.WhiteSmoke; chartArea1.BackSecondaryColor = System.Drawing.Color.White; chartArea1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.Name = "Default"; chartArea1.ShadowColor = System.Drawing.Color.Transparent; this.Chart1.ChartAreas.Add(chartArea1); legend1.BackColor = System.Drawing.Color.Transparent; legend1.Enabled = false; legend1.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); legend1.IsTextAutoFit = false; legend1.Name = "Default"; this.Chart1.Legends.Add(legend1); this.Chart1.Location = new System.Drawing.Point(16, 48); this.Chart1.Name = "Chart1"; series1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(180)))), ((int)(((byte)(26)))), ((int)(((byte)(59)))), ((int)(((byte)(105))))); series1.BorderWidth = 2; series1.ChartArea = "Default"; series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; series1.Legend = "Default"; series1.MarkerBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(64)))), ((int)(((byte)(10))))); series1.MarkerColor = System.Drawing.Color.FromArgb(((int)(((byte)(252)))), ((int)(((byte)(180)))), ((int)(((byte)(65))))); series1.MarkerSize = 8; series1.MarkerStyle = System.Windows.Forms.DataVisualization.Charting.MarkerStyle.Circle; series1.Name = "Default"; series1.Points.Add(dataPoint1); series1.Points.Add(dataPoint2); series1.Points.Add(dataPoint3); series1.Points.Add(dataPoint4); series1.Points.Add(dataPoint5); series1.Points.Add(dataPoint6); series1.Points.Add(dataPoint7); series1.Points.Add(dataPoint8); series1.Points.Add(dataPoint9); series1.Points.Add(dataPoint10); series1.Points.Add(dataPoint11); series1.Points.Add(dataPoint12); series1.Points.Add(dataPoint13); series1.Points.Add(dataPoint14); this.Chart1.Series.Add(series1); this.Chart1.Size = new System.Drawing.Size(412, 306); this.Chart1.TabIndex = 1; title1.Alignment = System.Drawing.ContentAlignment.MiddleLeft; title1.Font = new System.Drawing.Font("Trebuchet MS", 14.25F, System.Drawing.FontStyle.Bold); title1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(26)))), ((int)(((byte)(59)))), ((int)(((byte)(105))))); title1.Name = "Title1"; title1.ShadowColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); title1.ShadowOffset = 3; title1.Text = "Strip Lines"; this.Chart1.Titles.Add(title1); // // label10 // this.label10.Font = new System.Drawing.Font("Verdana", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label10.Location = new System.Drawing.Point(16, 367); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(702, 34); this.label10.TabIndex = 3; this.label10.Text = "Chart interlaced strip lines can also be enabled setting the Axis.IsInterlaced pr" + "operty."; this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // StripLines // this.BackColor = System.Drawing.Color.White; this.Controls.Add(this.label10); this.Controls.Add(this.Chart1); this.Controls.Add(this.panel1); this.Controls.Add(this.label9); this.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Name = "StripLines"; this.Size = new System.Drawing.Size(728, 424); this.panel1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.Chart1)).EndInit(); this.ResumeLayout(false); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); System.Windows.Forms.DataVisualization.Charting.StripLine stripLine1 = new System.Windows.Forms.DataVisualization.Charting.StripLine(); System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend(); System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series(); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint1 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 700); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint2 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 400); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint3 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 200); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint4 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 450); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint5 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 300); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint6 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 245); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint7 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 568); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint8 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 345); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint9 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 789); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint10 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 834); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint11 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 382); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint12 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 599); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint13 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 123); System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint14 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 223); System.Windows.Forms.DataVisualization.Charting.Title title1 = new System.Windows.Forms.DataVisualization.Charting.Title(); this.StripEndColor = new System.Windows.Forms.ComboBox(); this.StripColor = new System.Windows.Forms.ComboBox(); this.HatchStyle = new System.Windows.Forms.ComboBox(); this.Gradient = new System.Windows.Forms.ComboBox(); this.LineColor = new System.Windows.Forms.ComboBox(); this.StripLinesStyle = new System.Windows.Forms.ComboBox(); this.LineWidth = new System.Windows.Forms.ComboBox(); this.label2 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label(); this.label9 = new System.Windows.Forms.Label(); this.panel1 = new System.Windows.Forms.Panel(); this.label1 = new System.Windows.Forms.Label(); this.Interval = new System.Windows.Forms.ComboBox(); this.label11 = new System.Windows.Forms.Label(); this.Chart1 = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.label10 = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.Chart1)).BeginInit(); this.SuspendLayout(); // // StripEndColor // this.StripEndColor.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.StripEndColor.Items.AddRange(new object[] { "DarkRed", "Green", "Yellow", "SlateGray", "Gold" }); this.StripEndColor.Location = new System.Drawing.Point(168, 120); this.StripEndColor.Name = "StripEndColor"; this.StripEndColor.Size = new System.Drawing.Size(121, 22); this.StripEndColor.TabIndex = 9; this.StripEndColor.SelectedIndexChanged += new System.EventHandler(this.ControlChanged); // // StripColor // this.StripColor.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.StripColor.Items.AddRange(new object[] { "Red", "Gainsboro", "Khaki", "LightSteelBlue" }); this.StripColor.Location = new System.Drawing.Point(168, 48); this.StripColor.Name = "StripColor"; this.StripColor.Size = new System.Drawing.Size(121, 22); this.StripColor.TabIndex = 3; this.StripColor.SelectedIndexChanged += new System.EventHandler(this.ControlChanged); // // HatchStyle // this.HatchStyle.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.HatchStyle.Location = new System.Drawing.Point(168, 96); this.HatchStyle.Name = "HatchStyle"; this.HatchStyle.Size = new System.Drawing.Size(121, 22); this.HatchStyle.TabIndex = 7; this.HatchStyle.SelectedIndexChanged += new System.EventHandler(this.HatchControlChanged); // // Gradient // this.Gradient.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.Gradient.Location = new System.Drawing.Point(168, 72); this.Gradient.Name = "Gradient"; this.Gradient.Size = new System.Drawing.Size(121, 22); this.Gradient.TabIndex = 5; this.Gradient.SelectedIndexChanged += new System.EventHandler(this.GradienControlChanged); // // LineColor // this.LineColor.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.LineColor.Items.AddRange(new object[] { "MidnightBlue", "Green", "Black", "Red" }); this.LineColor.Location = new System.Drawing.Point(168, 184); this.LineColor.Name = "LineColor"; this.LineColor.Size = new System.Drawing.Size(121, 22); this.LineColor.TabIndex = 13; this.LineColor.SelectedIndexChanged += new System.EventHandler(this.ControlChanged); // // StripLinesStyle // this.StripLinesStyle.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.StripLinesStyle.Location = new System.Drawing.Point(168, 160); this.StripLinesStyle.Name = "StripLinesStyle"; this.StripLinesStyle.Size = new System.Drawing.Size(121, 22); this.StripLinesStyle.TabIndex = 11; this.StripLinesStyle.SelectedIndexChanged += new System.EventHandler(this.ControlChanged); // // LineWidth // this.LineWidth.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.LineWidth.Items.AddRange(new object[] { "1", "2", "3", "4", "5" }); this.LineWidth.Location = new System.Drawing.Point(168, 208); this.LineWidth.Name = "LineWidth"; this.LineWidth.Size = new System.Drawing.Size(121, 22); this.LineWidth.TabIndex = 15; this.LineWidth.SelectedIndexChanged += new System.EventHandler(this.ControlChanged); // // label2 // this.label2.Location = new System.Drawing.Point(20, 50); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(148, 16); this.label2.TabIndex = 2; this.label2.Text = "Back &Color:"; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label3 // this.label3.Location = new System.Drawing.Point(20, 122); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(148, 16); this.label3.TabIndex = 8; this.label3.Text = "S&econdary Back Color:"; this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label4 // this.label4.Location = new System.Drawing.Point(20, 74); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(148, 16); this.label4.TabIndex = 4; this.label4.Text = "&Gradient Style:"; this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label5 // this.label5.Location = new System.Drawing.Point(20, 98); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(148, 16); this.label5.TabIndex = 6; this.label5.Text = "&Hatch Style:"; this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label6 // this.label6.Location = new System.Drawing.Point(19, 162); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(148, 16); this.label6.TabIndex = 10; this.label6.Text = "Border &Style:"; this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label7 // this.label7.Location = new System.Drawing.Point(18, 186); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(148, 16); this.label7.TabIndex = 12; this.label7.Text = "&Border Color:"; this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label9 // this.label9.Font = new System.Drawing.Font("Verdana", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label9.Location = new System.Drawing.Point(16, 8); this.label9.Name = "label9"; this.label9.Size = new System.Drawing.Size(702, 34); this.label9.TabIndex = 0; this.label9.Text = "This sample demonstrates how to set the appearance properties of the StripLine ob" + "ject."; this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // panel1 // this.panel1.Controls.Add(this.label1); this.panel1.Controls.Add(this.Interval); this.panel1.Controls.Add(this.StripLinesStyle); this.panel1.Controls.Add(this.label5); this.panel1.Controls.Add(this.Gradient); this.panel1.Controls.Add(this.label6); this.panel1.Controls.Add(this.label4); this.panel1.Controls.Add(this.HatchStyle); this.panel1.Controls.Add(this.label7); this.panel1.Controls.Add(this.label3); this.panel1.Controls.Add(this.label2); this.panel1.Controls.Add(this.LineWidth); this.panel1.Controls.Add(this.StripEndColor); this.panel1.Controls.Add(this.StripColor); this.panel1.Controls.Add(this.LineColor); this.panel1.Controls.Add(this.label11); this.panel1.Location = new System.Drawing.Point(432, 56); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(292, 296); this.panel1.TabIndex = 2; // // label1 // this.label1.Location = new System.Drawing.Point(20, 11); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(148, 16); this.label1.TabIndex = 0; this.label1.Text = "Strip &Interval:"; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // Interval // this.Interval.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.Interval.Items.AddRange(new object[] { "2", "3", "4", "5" }); this.Interval.Location = new System.Drawing.Point(168, 8); this.Interval.Name = "Interval"; this.Interval.Size = new System.Drawing.Size(121, 22); this.Interval.TabIndex = 1; this.Interval.SelectedIndexChanged += new System.EventHandler(this.ControlChanged); // // label11 // this.label11.Location = new System.Drawing.Point(18, 211); this.label11.Name = "label11"; this.label11.Size = new System.Drawing.Size(148, 16); this.label11.TabIndex = 14; this.label11.Text = "Border Si&ze:"; this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // Chart1 // this.Chart1.BackColor = System.Drawing.Color.WhiteSmoke; this.Chart1.BackGradientStyle = System.Windows.Forms.DataVisualization.Charting.GradientStyle.TopBottom; this.Chart1.BackSecondaryColor = System.Drawing.Color.White; this.Chart1.BorderlineColor = System.Drawing.Color.FromArgb(((int)(((byte)(26)))), ((int)(((byte)(59)))), ((int)(((byte)(105))))); this.Chart1.BorderlineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Solid; this.Chart1.BorderlineWidth = 2; this.Chart1.BorderSkin.SkinStyle = System.Windows.Forms.DataVisualization.Charting.BorderSkinStyle.Emboss; chartArea1.Area3DStyle.Inclination = 15; chartArea1.Area3DStyle.IsClustered = true; chartArea1.Area3DStyle.IsRightAngleAxes = false; chartArea1.Area3DStyle.Perspective = 10; chartArea1.Area3DStyle.Rotation = 10; chartArea1.Area3DStyle.WallWidth = 0; chartArea1.AxisX.IsLabelAutoFit = false; chartArea1.AxisX.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); chartArea1.AxisX.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisX.MajorGrid.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); stripLine1.BackColor = System.Drawing.Color.Gainsboro; stripLine1.Interval = 2; stripLine1.IntervalOffset = 0.5; stripLine1.StripWidth = 1; chartArea1.AxisX.StripLines.Add(stripLine1); chartArea1.AxisY.IsLabelAutoFit = false; chartArea1.AxisY.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); chartArea1.AxisY.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisY.MajorGrid.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.BackColor = System.Drawing.Color.WhiteSmoke; chartArea1.BackSecondaryColor = System.Drawing.Color.White; chartArea1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.Name = "Default"; chartArea1.ShadowColor = System.Drawing.Color.Transparent; this.Chart1.ChartAreas.Add(chartArea1); legend1.BackColor = System.Drawing.Color.Transparent; legend1.Enabled = false; legend1.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); legend1.IsTextAutoFit = false; legend1.Name = "Default"; this.Chart1.Legends.Add(legend1); this.Chart1.Location = new System.Drawing.Point(16, 48); this.Chart1.Name = "Chart1"; series1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(180)))), ((int)(((byte)(26)))), ((int)(((byte)(59)))), ((int)(((byte)(105))))); series1.BorderWidth = 2; series1.ChartArea = "Default"; series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; series1.Legend = "Default"; series1.MarkerBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(64)))), ((int)(((byte)(10))))); series1.MarkerColor = System.Drawing.Color.FromArgb(((int)(((byte)(252)))), ((int)(((byte)(180)))), ((int)(((byte)(65))))); series1.MarkerSize = 8; series1.MarkerStyle = System.Windows.Forms.DataVisualization.Charting.MarkerStyle.Circle; series1.Name = "Default"; series1.Points.Add(dataPoint1); series1.Points.Add(dataPoint2); series1.Points.Add(dataPoint3); series1.Points.Add(dataPoint4); series1.Points.Add(dataPoint5); series1.Points.Add(dataPoint6); series1.Points.Add(dataPoint7); series1.Points.Add(dataPoint8); series1.Points.Add(dataPoint9); series1.Points.Add(dataPoint10); series1.Points.Add(dataPoint11); series1.Points.Add(dataPoint12); series1.Points.Add(dataPoint13); series1.Points.Add(dataPoint14); this.Chart1.Series.Add(series1); this.Chart1.Size = new System.Drawing.Size(412, 306); this.Chart1.TabIndex = 1; title1.Alignment = System.Drawing.ContentAlignment.MiddleLeft; title1.Font = new System.Drawing.Font("Trebuchet MS", 14.25F, System.Drawing.FontStyle.Bold); title1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(26)))), ((int)(((byte)(59)))), ((int)(((byte)(105))))); title1.Name = "Title1"; title1.ShadowColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); title1.ShadowOffset = 3; title1.Text = "Strip Lines"; this.Chart1.Titles.Add(title1); // // label10 // this.label10.Font = new System.Drawing.Font("Verdana", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label10.Location = new System.Drawing.Point(16, 367); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(702, 34); this.label10.TabIndex = 3; this.label10.Text = "Chart interlaced strip lines can also be enabled setting the Axis.IsInterlaced pr" + "operty."; this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // StripLines // this.BackColor = System.Drawing.Color.White; this.Controls.Add(this.label10); this.Controls.Add(this.Chart1); this.Controls.Add(this.panel1); this.Controls.Add(this.label9); this.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Name = "StripLines"; this.Size = new System.Drawing.Size(728, 424); this.panel1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.Chart1)).EndInit(); this.ResumeLayout(false); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); System.Windows.Forms.DataVisualization.Charting.StripLine stripLine1 = new System.Windows.Forms.DataVisualization.Charting.StripLine(); System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend(); System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series(); this.StripWidth = new System.Windows.Forms.ComboBox(); this.IntervalOffset = new System.Windows.Forms.ComboBox(); this.IntervalType = new System.Windows.Forms.ComboBox(); this.IntervalOffsetType = new System.Windows.Forms.ComboBox(); this.label5 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label(); this.label8 = new System.Windows.Forms.Label(); this.label9 = new System.Windows.Forms.Label(); this.panel1 = new System.Windows.Forms.Panel(); this.label2 = new System.Windows.Forms.Label(); this.StripWidthType = new System.Windows.Forms.ComboBox(); this.label1 = new System.Windows.Forms.Label(); this.StripInterval = new System.Windows.Forms.ComboBox(); this.Chart1 = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.Chart1)).BeginInit(); this.SuspendLayout(); // // StripWidth // this.StripWidth.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.StripWidth.Items.AddRange(new object[] { "0", "1", "2" }); this.StripWidth.Location = new System.Drawing.Point(168, 136); this.StripWidth.Name = "StripWidth"; this.StripWidth.Size = new System.Drawing.Size(121, 22); this.StripWidth.TabIndex = 4; this.StripWidth.SelectedIndexChanged += new System.EventHandler(this.ControlSelectedIndexChanged); // // IntervalOffset // this.IntervalOffset.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.IntervalOffset.Items.AddRange(new object[] { "1", "2" }); this.IntervalOffset.Location = new System.Drawing.Point(168, 72); this.IntervalOffset.Name = "IntervalOffset"; this.IntervalOffset.Size = new System.Drawing.Size(121, 22); this.IntervalOffset.TabIndex = 2; this.IntervalOffset.SelectedIndexChanged += new System.EventHandler(this.ControlSelectedIndexChanged); // // IntervalType // this.IntervalType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.IntervalType.Items.AddRange(new object[] { "Weeks", "Months" }); this.IntervalType.Location = new System.Drawing.Point(168, 40); this.IntervalType.Name = "IntervalType"; this.IntervalType.Size = new System.Drawing.Size(121, 22); this.IntervalType.TabIndex = 1; this.IntervalType.SelectedIndexChanged += new System.EventHandler(this.ControlSelectedIndexChanged); // // IntervalOffsetType // this.IntervalOffsetType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.IntervalOffsetType.Items.AddRange(new object[] { "Days", "Weeks" }); this.IntervalOffsetType.Location = new System.Drawing.Point(168, 104); this.IntervalOffsetType.Name = "IntervalOffsetType"; this.IntervalOffsetType.Size = new System.Drawing.Size(121, 22); this.IntervalOffsetType.TabIndex = 3; this.IntervalOffsetType.SelectedIndexChanged += new System.EventHandler(this.ControlSelectedIndexChanged); // // label5 // this.label5.Location = new System.Drawing.Point(14, 139); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(152, 16); this.label5.TabIndex = 13; this.label5.Text = "Strip &Width:"; this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label6 // this.label6.Location = new System.Drawing.Point(14, 43); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(152, 16); this.label6.TabIndex = 14; this.label6.Text = "Interval &Type:"; this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label7 // this.label7.Location = new System.Drawing.Point(14, 75); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(152, 16); this.label7.TabIndex = 15; this.label7.Text = "&Offset:"; this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label8 // this.label8.Location = new System.Drawing.Point(14, 107); this.label8.Name = "label8"; this.label8.Size = new System.Drawing.Size(152, 16); this.label8.TabIndex = 16; this.label8.Text = "Offset T&ype:"; this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label9 // this.label9.Font = new System.Drawing.Font("Verdana", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label9.Location = new System.Drawing.Point(16, 14); this.label9.Name = "label9"; this.label9.Size = new System.Drawing.Size(702, 43); this.label9.TabIndex = 2; this.label9.Text = "This sample demonstrates how to set the offset, interval, strip width, and width " + "type of a StripLine object."; this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // panel1 // this.panel1.Controls.Add(this.label2); this.panel1.Controls.Add(this.StripWidthType); this.panel1.Controls.Add(this.label1); this.panel1.Controls.Add(this.StripInterval); this.panel1.Controls.Add(this.IntervalType); this.panel1.Controls.Add(this.label5); this.panel1.Controls.Add(this.label6); this.panel1.Controls.Add(this.StripWidth); this.panel1.Controls.Add(this.label7); this.panel1.Controls.Add(this.label8); this.panel1.Controls.Add(this.IntervalOffsetType); this.panel1.Controls.Add(this.IntervalOffset); this.panel1.Location = new System.Drawing.Point(432, 73); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(292, 288); this.panel1.TabIndex = 0; // // label2 // this.label2.Location = new System.Drawing.Point(14, 171); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(152, 16); this.label2.TabIndex = 28; this.label2.Text = "Width Ty&pe:"; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // StripWidthType // this.StripWidthType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.StripWidthType.Items.AddRange(new object[] { "Days", "Weeks" }); this.StripWidthType.Location = new System.Drawing.Point(168, 168); this.StripWidthType.Name = "StripWidthType"; this.StripWidthType.Size = new System.Drawing.Size(121, 22); this.StripWidthType.TabIndex = 5; this.StripWidthType.SelectedIndexChanged += new System.EventHandler(this.ControlSelectedIndexChanged); // // label1 // this.label1.Location = new System.Drawing.Point(14, 11); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(152, 16); this.label1.TabIndex = 18; this.label1.Text = "&Interval:"; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // StripInterval // this.StripInterval.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.StripInterval.Items.AddRange(new object[] { "1", "2", "3" }); this.StripInterval.Location = new System.Drawing.Point(168, 8); this.StripInterval.Name = "StripInterval"; this.StripInterval.Size = new System.Drawing.Size(121, 22); this.StripInterval.TabIndex = 0; this.StripInterval.SelectedIndexChanged += new System.EventHandler(this.ControlSelectedIndexChanged); // // Chart1 // this.Chart1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(243)))), ((int)(((byte)(223)))), ((int)(((byte)(193))))); this.Chart1.BackGradientStyle = System.Windows.Forms.DataVisualization.Charting.GradientStyle.TopBottom; this.Chart1.BorderlineColor = System.Drawing.Color.FromArgb(((int)(((byte)(181)))), ((int)(((byte)(64)))), ((int)(((byte)(1))))); this.Chart1.BorderlineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Solid; this.Chart1.BorderlineWidth = 2; this.Chart1.BorderSkin.SkinStyle = System.Windows.Forms.DataVisualization.Charting.BorderSkinStyle.Emboss; chartArea1.Area3DStyle.Inclination = 15; chartArea1.Area3DStyle.IsClustered = true; chartArea1.Area3DStyle.IsRightAngleAxes = false; chartArea1.Area3DStyle.Perspective = 10; chartArea1.Area3DStyle.Rotation = 10; chartArea1.Area3DStyle.WallWidth = 0; chartArea1.AxisX.IsLabelAutoFit = false; chartArea1.AxisX.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); chartArea1.AxisX.LabelStyle.Format = "d MMM"; chartArea1.AxisX.LabelStyle.IsStaggered = true; chartArea1.AxisX.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisX.MajorGrid.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); stripLine1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(241)))), ((int)(((byte)(185)))), ((int)(((byte)(168))))); stripLine1.Interval = 2; stripLine1.StripWidth = 1; chartArea1.AxisX.StripLines.Add(stripLine1); chartArea1.AxisY.IsLabelAutoFit = false; chartArea1.AxisY.IsStartedFromZero = false; chartArea1.AxisY.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); chartArea1.AxisY.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisY.MajorGrid.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisY2.MajorGrid.Enabled = false; chartArea1.BackColor = System.Drawing.Color.OldLace; chartArea1.BackGradientStyle = System.Windows.Forms.DataVisualization.Charting.GradientStyle.TopBottom; chartArea1.BackSecondaryColor = System.Drawing.Color.White; chartArea1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.Name = "Default"; chartArea1.ShadowColor = System.Drawing.Color.Transparent; this.Chart1.ChartAreas.Add(chartArea1); legend1.BackColor = System.Drawing.Color.Transparent; legend1.Enabled = false; legend1.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); legend1.IsTextAutoFit = false; legend1.Name = "Default"; this.Chart1.Legends.Add(legend1); this.Chart1.Location = new System.Drawing.Point(16, 65); this.Chart1.Name = "Chart1"; series1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(180)))), ((int)(((byte)(26)))), ((int)(((byte)(59)))), ((int)(((byte)(105))))); series1.ChartArea = "Default"; series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Stock; series1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(140)))), ((int)(((byte)(240))))); series1.Legend = "Default"; series1.Name = "Default"; series1.ShadowOffset = 1; series1.YValuesPerPoint = 4; this.Chart1.Series.Add(series1); this.Chart1.Size = new System.Drawing.Size(412, 296); this.Chart1.TabIndex = 1; // // StripIntervals // this.Controls.Add(this.Chart1); this.Controls.Add(this.panel1); this.Controls.Add(this.label9); this.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Name = "StripIntervals"; this.Size = new System.Drawing.Size(728, 480); this.Load += new System.EventHandler(this.StripIntervals_Load); this.panel1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.Chart1)).EndInit(); this.ResumeLayout(false); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); System.Windows.Forms.DataVisualization.Charting.StripLine stripLine1 = new System.Windows.Forms.DataVisualization.Charting.StripLine(); System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend(); System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series(); System.Windows.Forms.DataVisualization.Charting.Title title1 = new System.Windows.Forms.DataVisualization.Charting.Title(); this.label9 = new System.Windows.Forms.Label(); this.panel1 = new System.Windows.Forms.Panel(); this.label6 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.label15 = new System.Windows.Forms.Label(); this.Chart1 = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.label1 = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.Chart1)).BeginInit(); this.SuspendLayout(); // // label9 // this.label9.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.label9.Font = new System.Drawing.Font("Verdana", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label9.Location = new System.Drawing.Point(16, 8); this.label9.Name = "label9"; this.label9.Size = new System.Drawing.Size(702, 34); this.label9.TabIndex = 0; this.label9.Text = "This sample demonstrates how to use the GetToolTipText event to retrieve or modif" + "y tooltip text."; this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // panel1 // this.panel1.Controls.Add(this.label6); this.panel1.Controls.Add(this.label5); this.panel1.Controls.Add(this.label4); this.panel1.Controls.Add(this.label3); this.panel1.Controls.Add(this.label15); this.panel1.Location = new System.Drawing.Point(432, 68); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(292, 288); this.panel1.TabIndex = 19; // // label6 // this.label6.Location = new System.Drawing.Point(64, 403); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(100, 23); this.label6.TabIndex = 5; this.label6.Text = "Border Size:"; // // label5 // this.label5.Location = new System.Drawing.Point(64, 380); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(100, 23); this.label5.TabIndex = 4; this.label5.Text = "Border Color:"; // // label4 // this.label4.Location = new System.Drawing.Point(64, 357); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(100, 23); this.label4.TabIndex = 3; this.label4.Text = "Hatch Style:"; // // label3 // this.label3.Location = new System.Drawing.Point(64, 334); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(100, 23); this.label3.TabIndex = 2; this.label3.Text = "Gradient:"; // // label15 // this.label15.Location = new System.Drawing.Point(64, 426); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(100, 23); this.label15.TabIndex = 5; this.label15.Text = "Border Size:"; // // Chart1 // this.Chart1.BackColor = System.Drawing.Color.WhiteSmoke; this.Chart1.BackGradientStyle = System.Windows.Forms.DataVisualization.Charting.GradientStyle.TopBottom; this.Chart1.BackSecondaryColor = System.Drawing.Color.White; this.Chart1.BorderlineColor = System.Drawing.Color.FromArgb(((int)(((byte)(26)))), ((int)(((byte)(59)))), ((int)(((byte)(105))))); this.Chart1.BorderlineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Solid; this.Chart1.BorderlineWidth = 2; this.Chart1.BorderSkin.SkinStyle = System.Windows.Forms.DataVisualization.Charting.BorderSkinStyle.Emboss; chartArea1.Area3DStyle.Inclination = 15; chartArea1.Area3DStyle.IsClustered = true; chartArea1.Area3DStyle.IsRightAngleAxes = false; chartArea1.Area3DStyle.Perspective = 10; chartArea1.Area3DStyle.Rotation = 10; chartArea1.Area3DStyle.WallWidth = 0; chartArea1.AxisX.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); chartArea1.AxisX.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisX.MajorGrid.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisX.ScaleView.Position = 3; chartArea1.AxisX.ScaleView.Size = 30; chartArea1.AxisX.ScrollBar.ButtonColor = System.Drawing.Color.LightGray; chartArea1.AxisX.ScrollBar.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); stripLine1.Interval = 20; stripLine1.StripWidth = 5; chartArea1.AxisX.StripLines.Add(stripLine1); chartArea1.AxisX2.Enabled = System.Windows.Forms.DataVisualization.Charting.AxisEnabled.False; chartArea1.AxisY.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); chartArea1.AxisY.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisY.MajorGrid.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisY.ScaleView.Position = 5; chartArea1.AxisY.ScaleView.Size = 10; chartArea1.AxisY.ScrollBar.ButtonColor = System.Drawing.Color.LightGray; chartArea1.AxisY.ScrollBar.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisY2.Enabled = System.Windows.Forms.DataVisualization.Charting.AxisEnabled.False; chartArea1.BackColor = System.Drawing.Color.Gainsboro; chartArea1.BackGradientStyle = System.Windows.Forms.DataVisualization.Charting.GradientStyle.TopBottom; chartArea1.BackSecondaryColor = System.Drawing.Color.White; chartArea1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.CursorX.IsUserEnabled = true; chartArea1.CursorX.IsUserSelectionEnabled = true; chartArea1.CursorY.IsUserEnabled = true; chartArea1.CursorY.IsUserSelectionEnabled = true; chartArea1.Name = "Default"; chartArea1.ShadowColor = System.Drawing.Color.Transparent; this.Chart1.ChartAreas.Add(chartArea1); legend1.BackColor = System.Drawing.Color.Transparent; legend1.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); legend1.IsTextAutoFit = false; legend1.Name = "Default"; this.Chart1.Legends.Add(legend1); this.Chart1.Location = new System.Drawing.Point(16, 48); this.Chart1.Name = "Chart1"; series1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(180)))), ((int)(((byte)(26)))), ((int)(((byte)(59)))), ((int)(((byte)(105))))); series1.ChartArea = "Default"; series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; series1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(64)))), ((int)(((byte)(10))))); series1.Legend = "Default"; series1.MarkerSize = 8; series1.MarkerStyle = System.Windows.Forms.DataVisualization.Charting.MarkerStyle.Circle; series1.Name = "Series1"; series1.ShadowOffset = 2; this.Chart1.Series.Add(series1); this.Chart1.Size = new System.Drawing.Size(412, 296); this.Chart1.TabIndex = 0; title1.Font = new System.Drawing.Font("Trebuchet MS", 14.25F, System.Drawing.FontStyle.Bold); title1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(26)))), ((int)(((byte)(59)))), ((int)(((byte)(105))))); title1.Name = "Title1"; title1.ShadowColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); title1.ShadowOffset = 3; title1.Text = "Custom ToolTips"; this.Chart1.Titles.Add(title1); this.Chart1.GetToolTipText += new System.EventHandler <System.Windows.Forms.DataVisualization.Charting.ToolTipEventArgs>(this.Chart1_GetToolTipText); // // label1 // this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.label1.Font = new System.Drawing.Font("Verdana", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label1.Location = new System.Drawing.Point(16, 352); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(708, 36); this.label1.TabIndex = 20; this.label1.Text = "Move the mouse cursor over the chart elements to see different tooltip text."; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // CustomToolTips // this.Controls.Add(this.label1); this.Controls.Add(this.Chart1); this.Controls.Add(this.panel1); this.Controls.Add(this.label9); this.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Name = "CustomToolTips"; this.Size = new System.Drawing.Size(728, 480); this.Load += new System.EventHandler(this.CustomToolTips_Load); this.panel1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.Chart1)).EndInit(); this.ResumeLayout(false); }
private void UpdateGraph(int selnum) { if (mainDB == null) return; if (mainDB[selnum] == null) return; int tgnum = mainDB[selnum].TGS.Count; Legend[] lgds = new Legend[tgnum]; Series[] srsX = new Series[tgnum]; Series[] srsY = new Series[tgnum]; vchart.Legends.Clear(); hchart.Legends.Clear(); vchart.Series.Clear(); hchart.Series.Clear(); vchart.ChartAreas[0].AxisX.StripLines.Clear(); hchart.ChartAreas[0].AxisX.StripLines.Clear(); StripLine ln = new StripLine(); ln.BorderColor = Color.Red; ln.IntervalOffset = m_TargetLimit * 1000; ln.BorderWidth = 4; vchart.ChartAreas[0].AxisY.StripLines.Add(ln); hchart.ChartAreas[0].AxisY.StripLines.Add(ln); vchart.ChartAreas[0].AxisY.Maximum = m_TargetLimit * 1000 + 5; hchart.ChartAreas[0].AxisY.Maximum = m_TargetLimit * 1000 + 5; switch (obstype) { case 0: vchart.ChartAreas[0].AxisX.LabelStyle.Format = "HH:mm:ss"; hchart.ChartAreas[0].AxisX.LabelStyle.Format = "HH:mm:ss"; break; case 1: vchart.ChartAreas[0].AxisX.LabelStyle.Format = "DD HH:mm"; hchart.ChartAreas[0].AxisX.LabelStyle.Format = "DD HH:mm"; break; case 2: vchart.ChartAreas[0].AxisX.LabelStyle.Format = "DD HH:mm"; hchart.ChartAreas[0].AxisX.LabelStyle.Format = "DD HH:mm"; break; } for (int i = 0; i < tgnum; i++) { TG tg = (TG)mainDB[selnum].TGS[i]; //레전드 생성 lgds[i] = new Legend(tg.m_ID); lgds[i].Name = tg.m_ID; lgds[i].BackColor = System.Drawing.Color.Transparent; lgds[i].Enabled = true; lgds[i].Font = new System.Drawing.Font("굴림", 8.25F, System.Drawing.FontStyle.Bold); lgds[i].IsTextAutoFit = false; lgds[i].DockedToChartArea = "ChartArea1"; lgds[i].IsDockedInsideChartArea = true; vchart.Legends.Add(lgds[i]); hchart.Legends.Add(lgds[i]); //데이터 넣기 srsX[i] = new Series(); srsY[i] = new Series(); int count = tg.Arr.Count; for (int j = 0; j < count; j++) { COORD cd = (COORD)tg.Arr[j]; DataPoint dt = new DataPoint(); DataPoint dt2 = new DataPoint(); switch (obstype) { case 0: dt.SetValueXY(string.Format("{0:00}:{1:00}:{2:00}", cd.hour, cd.min, cd.sec), cd.dx * 1000); dt2.SetValueXY(string.Format("{0:00}:{1:00}:{2:00}", cd.hour, cd.min, cd.sec), cd.dy * 1000); break; case 1: dt.SetValueXY(string.Format("{0:00} {1:00}:{2:00}", cd.day, cd.hour, cd.min), cd.dx * 1000); dt2.SetValueXY(string.Format("{0:00} {1:00}:{2:00}", cd.day, cd.hour, cd.min), cd.dy * 1000); break; case 2: dt.SetValueXY(string.Format("{0:00} {1:00}:{2:00}", cd.day, cd.hour, cd.min), cd.dx * 1000); dt2.SetValueXY(string.Format("{0:00} {1:00}:{2:00}", cd.day, cd.hour, cd.min), cd.dy * 1000); break; } srsX[i].Points.Add(dt); srsY[i].Points.Add(dt2); } srsX[i].Name = lgds[i].Name + "번"; srsX[i].ChartArea = "ChartArea1"; srsX[i].ChartType = SeriesChartType.Line; srsX[i].Legend = lgds[i].Name; srsX[i].Color = lcolors[i]; srsX[i].BorderWidth = 2; srsY[i].Name = lgds[i].Name + "번"; srsY[i].ChartArea = "ChartArea1"; srsY[i].ChartType = SeriesChartType.Line; srsY[i].Legend = lgds[i].Name; srsY[i].Color = lcolors[i]; srsY[i].BorderWidth = 2; hchart.Series.Add(srsX[i]); vchart.Series.Add(srsY[i]); } }
// essa função é chamada no analisar corrida ao inserir os pontos private void CreateStripLines(double pMaxSpeed, double pAvgSpeed) { StripLine maxSpeedLine = new StripLine(); StripLine avgSpeedLine = new StripLine(); maxSpeedLine.Interval = avgSpeedLine.Interval = 0; maxSpeedLine.StripWidth = avgSpeedLine.StripWidth = AUX_SPEED_LINE_WIDTH; maxSpeedLine.BackColor = MAX_SPEED_COLOR; avgSpeedLine.BackColor = AVG_SPEED_COLOR; // IntervalOffset é o valor das velocidades max, min e média, que serão setados em AnalisarCorrida maxSpeedLine.IntervalOffset = pMaxSpeed; avgSpeedLine.IntervalOffset = pAvgSpeed; chartsNew.ChartAreas["Speed"].AxisY.StripLines.Add(maxSpeedLine); chartsNew.ChartAreas["Speed"].AxisY.StripLines.Add(avgSpeedLine); chartsNew.Update(); }