| | |
| | | _line_visible = value; |
| | | _const_line_x.Visible = value; |
| | | _const_line_y.Visible = value; |
| | | _anno_txt_query_info.Visible = value; |
| | | SetAxisXValue(); |
| | | } |
| | | } |
| | |
| | | { |
| | | this.chartControl1.SetChartDisplay(); |
| | | this.chartControl1.RuntimeHitTesting = true; |
| | | this.chartControl1.AnimationStartMode = ChartAnimationMode.OnLoad; |
| | | //this.chartControl1.AnimationStartMode = ChartAnimationMode.OnLoad; |
| | | //this.chartControl1.SeriesSelectionMode = SeriesSelectionMode.Series; |
| | | //this.chartControl1.SelectionMode = ElementSelectionMode.Single; |
| | | |
| | | this.chartControl1.ObjectHotTracked += new DevExpress.XtraCharts.HotTrackEventHandler(this.chartControl1_ObjectHotTracked); |
| | | this.chartControl1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.chartControl1_MouseMove); |
| | | this.chartControl1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.chartControl1_MouseUp); |
| | |
| | | _axis_y_power = _diagram.SecondaryAxesY.GetAxisByName("AxisYPower"); |
| | | _axis_y_power.SetSecondaryAxisYQPDisplay(); |
| | | |
| | | |
| | | _const_line_x = (ConstantLine)_diagram.AxisX.ConstantLines.GetElementByName("ConstantLineX"); |
| | | _const_line_x.SetWorkPointLineDisplay(); |
| | | |
| | |
| | | _axis_y_power.GridLines.Visible = false; |
| | | |
| | | _const_line_x.Visible = false; |
| | | _const_line_y.Visible = false; |
| | | _const_line_y.Visible = false; |
| | | |
| | | _anno_txt_query_info = this.chartControl1.AnnotationRepository[0] as TextAnnotation; |
| | | _anno_txt_query_info.SetTextAnnoWorkPointDisplay(); |
| | | _anno_txt_query_info.Visible = false; |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 初始化坐标轴 |
| | |
| | | |
| | | private void chartControl1_Resize(object sender, EventArgs e) |
| | | { |
| | | var x = this.chartControl1.Location.X + this.chartControl1.Width; |
| | | var y = this.chartControl1.Location.Y + 100; |
| | | |
| | | (_anno_txt_query_info.AnchorPoint as ChartAnchorPoint).X = x; |
| | | (_anno_txt_query_info.AnchorPoint as ChartAnchorPoint).Y = y; |
| | | } |
| | | |
| | | |
| | | private void ChartControl1_CustomPaint(object sender, CustomPaintEventArgs e) |
| | | { |
| | |
| | | _const_line_x.Title.Visible = false; |
| | | _const_line_y.Visible = false; |
| | | _const_line_y.Title.Visible = false; |
| | | _anno_txt_query_info.Visible = false; |
| | | return; |
| | | } |
| | | else |
| | |
| | | _const_line_x.Title.Visible = true; |
| | | _const_line_y.Visible = true; |
| | | _const_line_y.Title.Visible = true; |
| | | _anno_txt_query_info.Visible = true; |
| | | } |
| | | if (this.IsInvalidData()) |
| | | return; |
| | |
| | | |
| | | _const_line_y.AxisValue = y_value; |
| | | _const_line_y.Title.Text = $"{y_value:N1}"; |
| | | |
| | | var query_info_builder = new StringBuilder(); |
| | | query_info_builder.AppendLine($"{x_value:N2} m³/h "); |
| | | query_info_builder.AppendLine($"{y_value:N2} m"); |
| | | |
| | | _anno_txt_query_info.Text = query_info_builder.ToString(); |
| | | _anno_txt_query_info.AutoSize = true; |
| | | _anno_txt_query_info.Visible = true; |
| | | |
| | | } |
| | | |
| | | /// <summary> |