private void LoadChart() { this.fieldY = GetFieldY(); this.Text = this.GetTitle(); ResFormulaService resFormulaService = new ResFormulaService(); DataTable dtHistoryMonthData = resFormulaService.GetDYMonthDataTable(assetsData.DYDM, ycqsrq); dtHistoryMonthData = DealDataSource(dtHistoryMonthData); List <NodeEnity> lstNE = assetsData.GetLstNodeEntity(); PreMonthDataService pmds = new PreMonthDataService(); dtPreMonthData = pmds.GetDataTable(assetsData.ProID, pjnd, lstNE); DYMonthDataService dds = new DYMonthDataService(); double ljcy = dds.GetLJCL(assetsData.DYDM, ycqsrq); DoWithDT(ref dtPreMonthData, ljcy); #region 图形加载 try { ChartData chartdata = getDefaultData("累产油(万吨)", new List <DataTable>() { dtHistoryMonthData, dtPreMonthData }); CInitializeChart initailize = new CInitializeChart(); initailize.InitializeChart(jrChart1, chartdata); ((OprtFitting)jrChart1.oprt).PredictionEvent += new OprtFitting.Event_Prediction(jrChart1_PredictionEvent); ChartSeries sr_In = jrChart1.chartdata.serieslst[0]; jrChart1.AllowMouseWheelZoom = true;//鼠标可缩放。 jrChart1.AllowDrop = false; sr_In.bkclr = Color.White; sr_In.VLineColor = Color.Black; sr_In.HLineColor = Color.Black; this.jrChart1.RepaintAll(); } catch (Exception ex) { MessageBox.Show(ex.Message + "数据有误不能加载数据"); return; } #endregion }
public void Init(DecParams decParams) { Log.Info("开始初始化DYChartWindow..."); if (uctChart1.Visible == false) { uctChart1.Visible = true; } ResFormulaService resFormulaService = new ResFormulaService(); DataTable dtDyKFSJ = resFormulaService.GetDYMonthDataTable(decParams.Dydm, decParams.Ycqsrq); VertAxisStateService vass = new VertAxisStateService(); DataTable dtVertAxisState = vass.GetDataTable(decParams.ProID, decParams.Pjnd, decParams.Dydm, StudyType.DYFX); this.uctChart1.LoadChart(GlobalInfo.DYTemplate, GlobalInfo.DYSeriesOptions, GlobalInfo.DYBDTemplate, dtDyKFSJ, dtVertAxisState, decParams, StudyType.DYFX, null); uctChart1_RefreshUctDecLine(null, null); //有可能要刷新网格 this.RefreshDataGridView(); this.RefreshBDChart(); Log.Info("结束初始化DYChartWindow..."); }