/// <summary> /// /// </summary> /// <returns></returns> private GraphPaneConfig GetGraphPaneConfig(DataTable tbl) { ColorProvider cp = new ColorProvider(); GraphPaneConfig cfg = new GraphPaneConfig(); cfg.Title = DataEnumClass.GetDataEnumString(this.DataEnum) + "曲线"; if (this.DataEnum == DataEnum.WL) { cfg.YTitle = strings.WLWithUnit; } if (this.DataEnum == DataEnum.Amount) { cfg.YTitle = strings.AmountWithUnit; } cfg.XTitle = "时间"; cfg.CurItemType = CurveItemType.Line; cfg.XAxisType = ZedGraph.AxisType.Date; for (int i = 1; i < tbl.Columns.Count; i++) { DataColumn col = tbl.Columns[i]; SingleCurveConfig item = new SingleCurveConfig(); item.Color = cp.GetNextColor(); item.Name = col.ColumnName; item.XDataField = "DT"; item.YDataField = col.ColumnName; cfg.CurveConfigBaseCollection.Add(item); } return(cfg); }
/// <summary> /// /// </summary> /// <returns></returns> static public GraphPaneConfig CreateNeedDistributeGraphPaneConfig() { ColorProvider cp = new ColorProvider(); GraphPaneConfig cfg = new GraphPaneConfig(); cfg.XAxisType = ZedGraph.AxisType.Text; cfg.XTitle = strings.WaterUserName; cfg.YTitle = strings.Amount; cfg.CurItemType = CurveItemType.Bar; SingleCurveConfig scc = new SingleCurveConfig(); scc.Name = strings.NeedAmount; scc.Color = cp.GetNextColor(); scc.XDataField = tblNeedDistribute.WaterUserName; scc.YDataField = tblNeedDistribute.NeedAmount; cfg.CurveConfigBaseCollection.Add(scc); scc = new SingleCurveConfig(); scc.Name = strings.DistributeAmount; scc.Color = cp.GetNextColor(); scc.XDataField = tblNeedDistribute.WaterUserName; scc.YDataField = tblNeedDistribute.DistributeAmount; cfg.CurveConfigBaseCollection.Add(scc); scc = new SingleCurveConfig(); scc.Name = strings.UsedAmount; scc.Color = cp.GetNextColor(); scc.XDataField = tblNeedDistribute.WaterUserName; scc.YDataField = tblNeedDistribute.UsedAmount; cfg.CurveConfigBaseCollection.Add(scc); return(cfg); }
/// <summary> /// /// </summary> /// <param name="tbl"></param> /// <returns></returns> private Xdgk.UI.Z.GraphPaneConfig GetGraphPaneConfig(DataTable tbl) { ColorProvider cp = new ColorProvider(); GraphPaneConfig cfg = new GraphPaneConfig(); cfg.Title = "放水季用水量曲线"; cfg.XTitle = strings.DuringWater; cfg.YTitle = strings.AmountWithUnit; cfg.XAxisType = ZedGraph.AxisType.Text; for (int i = 3; i < tbl.Columns.Count; i++) { SingleCurveConfig scc = new SingleCurveConfig(); scc.Name = tbl.Columns[i].ColumnName; scc.XDataField = "放水季"; scc.YDataField = tbl.Columns[i].ColumnName; scc.Color = cp.GetNextColor(); cfg.CurveConfigBaseCollection.Add(scc); } return(cfg); }