| | |
| | | namespace Yw.WinFrmUI.Phart |
| | | using Yw.Ahart; |
| | | |
| | | namespace Yw.WinFrmUI.Phart |
| | | { |
| | | public partial class UniversalChartExcelEditCtrl : DevExpress.XtraEditors.XtraUserControl |
| | | { |
| | |
| | | this.colX.Caption = axis_x_title; |
| | | this.colY.Caption = axis_y_title; |
| | | |
| | | this.universalEditChart1.AxisXTitle = axis_x_title; |
| | | this.universalEditChart1.AxisYTitle = axis_y_title; |
| | | this.universalEditChart1.AxisXTitle = axis_x_title; |
| | | this.universalEditChart1.AxisYTitle = axis_y_title; |
| | | |
| | | this.barEditModel.EditValue = 0; |
| | | this.barFeatType.EditValue = _feat_type; |
| | |
| | | { |
| | | if (def_pt_list == null || def_pt_list.Count < 4) |
| | | { |
| | | this.universalEditChart1.Clear(); |
| | | this.universalEditChart1.Clear(); |
| | | return; |
| | | } |
| | | var fit_pt_list = def_pt_list.GetPointList(feat_type); |
| | |
| | | private void barEditModel_EditValueChanged(object sender, EventArgs e) |
| | | { |
| | | var index = (int)this.barEditModel.EditValue; |
| | | this.universalEditChart1.MouseModel = index == 0; |
| | | this.universalEditChart1.MouseModel = index == 0; |
| | | } |
| | | |
| | | //添加点 |
| | |
| | | private void btnDelete_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | if (_def_pt_list == null || !_def_pt_list.Any()) |
| | | return; |
| | | if (_def_pt_list == null || _def_pt_list.Count <= 4) |
| | | return; |
| | | return; |
| | | var row = this.gridView1.GetCurrentViewModel(_def_pt_list); |
| | | if (row == null) |
| | | return; |
| | | return; |
| | | var count = _def_pt_list.Count - 1; |
| | | switch (_feat_type) |
| | | { |
| | | case Ahart.eFeatType.Cubic: |
| | | { |
| | | if (count < 4) |
| | | { |
| | | TipFormHelper.ShowInfo("点数少于4个点"); |
| | | return; |
| | | } |
| | | } |
| | | break; |
| | | case Ahart.eFeatType.Through: |
| | | { |
| | | if (count < 1) |
| | | { |
| | | TipFormHelper.ShowInfo("点数少于1个点"); |
| | | return; |
| | | } |
| | | } |
| | | break; |
| | | case Ahart.eFeatType.Quadratic: |
| | | { |
| | | if (count < 3) |
| | | { |
| | | TipFormHelper.ShowInfo("点数少于3个点"); |
| | | return; |
| | | } |
| | | } |
| | | break; |
| | | case Ahart.eFeatType.Quartic: |
| | | { |
| | | if (count < 5) |
| | | { |
| | | TipFormHelper.ShowInfo("点数少于5个点"); |
| | | return; |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | |
| | | _def_pt_list.Remove(row); |
| | | this.bindingSource1.ResetBindings(false); |
| | | SetChart(_feat_type, _def_pt_list); |