chart2.Titles.Add(title); chart2.ChartAreas.Clear(); ChartArea chartArea2= chart2.ChartAreas.Add ("Default"); chartArea2.Area3DStyle.Inclination = 15; chartArea2.Area3DStyle.IsClustered = true; chartArea2.Area3DStyle.IsRightAngleAxes = false; chartArea2.Area3DStyle.Perspective = 10; chartArea2.Area3DStyle.PointGapDepth = 0; chartArea2.Area3DStyle.Rotation = 5; chartArea2.Area3DStyle.WallWidth = 0; chartArea2.AxisX.IsLabelAutoFit = false; chartArea2.AxisX.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); chartArea2.AxisX.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea2.AxisX.MajorGrid.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea2.AxisX.MajorTickMark.Interval = 0; chartArea2.AxisX.MinorTickMark.Interval = 1; chartArea2.AxisX.ScaleView.SizeType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Number; chartArea2.AxisX.ScrollBar.ButtonColor = System.Drawing.Color.LightSteelBlue; chartArea2.AxisX.ScrollBar.LineColor = System.Drawing.Color.DimGray; chartArea2.AxisY.IsLabelAutoFit = false; chartArea2.AxisY.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); chartArea2.AxisY.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea2.AxisY.MajorGrid.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea2.BackColor = System.Drawing.Color.Transparent; chartArea2.BackSecondaryColor = System.Drawing.Color.White; chartArea2.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea2.CursorX.IsUserEnabled = true; chartArea2.CursorX.IsUserSelectionEnabled = true; chartArea2.Name = "Default"; chartArea2.Position.Auto = false; chartArea2.Position.Height = 75F; chartArea2.Position.Width = 90F; chartArea2.Position.X = 2F; chartArea2.Position.Y = 13F; chartArea2.ShadowColor = System.Drawing.Color.Transparent; chart2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(211)))), ((int)(((byte)(223)))), ((int)(((byte)(240))))); chart2.BackGradientStyle = System.Windows.Forms.DataVisualization.Charting.GradientStyle.TopBottom; chart2.BorderlineColor = System.Drawing.Color.FromArgb(((int)(((byte)(26)))), ((int)(((byte)(59)))), ((int)(((byte)(105))))); chart2.BorderlineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Solid; chart2.BorderlineWidth = 2; chart2.BorderSkin.SkinStyle = System.Windows.Forms.DataVisualization.Charting.BorderSkinStyle.Emboss; // Populate series with random data chart2.Series.Clear(); Series s1 = new Series(); s1.LegendText = "MR"; s1.ChartArea = chartArea2.Name ; s1.ChartType = SeriesChartType.Line; s1.Color = Color.Red; foreach (DataRow dr in dt1.Rows) { s1.Points.AddXY(Convert.ToString(dr["start_time".ToUpper()]), Convert.ToInt32(dr["rscp".ToUpper()])); } if (DistanceControl == null) { if (s1.Points.Count > 0) { chart2.Series.Add(s1); } } else { if (s1.Points.Count > 0 && DistanceControl.ceMR.Checked) { chart2.Series.Add(s1); } } Series s2 = new Series(); s2.LegendText = "路测"; s2.ChartArea = chartArea2.Name; s2.Color = Color.Blue; s2.ChartType = SeriesChartType.Line; foreach (DataRow dr in dt2.Rows) { s2.Points.AddXY(Convert.ToString(dr["start_time".ToUpper()]), Convert.ToInt32(dr["aset_rscp1".ToUpper()])); } if (DistanceControl == null) { if (s2.Points.Count > 0) { chart2.Series.Add(s2); } } else { if (s2.Points.Count > 0 && DistanceControl.ceRoute.Checked) { chart2.Series.Add(s2); } } // Set point labels s1.IsValueShownAsLabel = false; s2.IsValueShownAsLabel = false; // Enable X axis margin chart2.ChartAreas["Default"].AxisX.IsMarginVisible = true;