| | |
| | | public void SetBindingData(List<Yw.Geometry.Point2d> point_pt_list, List<Yw.Geometry.Point2d> line_pt_list, string coordinate = null, Color? color = null) |
| | | { |
| | | _initial_data = false; |
| | | _point_pt_list = point_pt_list; |
| | | _line_pt_list = line_pt_list; |
| | | _point_pt_list = point_pt_list?.Select(x => new Geometry.Point2d(x.X, x.Y)).ToList(); |
| | | _line_pt_list = line_pt_list?.Select(x => new Geometry.Point2d(x.X, x.Y)).ToList(); |
| | | _coordinate = UniversalCoordinate.ToModel(coordinate); |
| | | _series_pt = null; |
| | | |
| | | if (color == null) |
| | | color = Color.DodgerBlue; |
| | | |
| | | this.chartControl1.BeginInit(); |
| | | this.chartControl1.Series.Clear(); |
| | |
| | | |
| | | //是否是无效数据 |
| | | private bool IsInvalidData() |
| | | { |
| | | if (!_initial_data) |
| | | return true; |
| | | { |
| | | if (_point_pt_list == null || !_point_pt_list.Any()) |
| | | { |
| | | return true; |
| | |
| | | if (_line_pt_list == null || !_line_pt_list.Any()) |
| | | { |
| | | return true; |
| | | } |
| | | if (_series_pt == null) |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | |
| | | { |
| | | var pt = pt_list[i]; |
| | | var series_pt = new DevExpress.XtraCharts.SeriesPoint(pt.X, new double[] { pt.Y }); |
| | | series_pt.Tag = i; |
| | | series_pt_list.Add(series_pt); |
| | | } |
| | | |
| | |
| | | return; |
| | | var x = _series_pt.Points[_pick_point_index].NumericalArgument; |
| | | var y = _series_pt.Points[_pick_point_index].Values[0]; |
| | | x = Math.Round(x, 2); |
| | | y = Math.Round(y, 2); |
| | | SetPointValue(_pick_point_index, x, y); |
| | | _pick_point_index = -1; |
| | | } |
| | |
| | | { |
| | | x += space_x; |
| | | } |
| | | x = Math.Round(x, 2); |
| | | y = Math.Round(y, 2); |
| | | _series_pt.Points[_pick_point_index].NumericalArgument = x; |
| | | _series_pt.Points[_pick_point_index].Values[0] = y; |
| | | SetPointValue(_pick_point_index, x, y); |
| | | } |
| | | |