110,577
社区成员
发帖
与我相关
我的任务
分享
//环境因素随时间变化图。
private void Show(string _where,string SItems)
{
DataSet ds = new DataSet();
DataTable dt = new DataTable();
switch (SItems)
{
case "二氧化碳":
BLL.CO2_Data b_Co2 = new Maticsoft.BLL.CO2_Data();
ds = b_Co2.GetList(0, _where, "This_DateTime");
C1WebChart2.Visible = true;
dt = ds.Tables[0];
if (dt != null)
{
C1WebChart2.DataSource = dt;
ChartDataSeriesCollection sc = this.C1WebChart2.ChartGroups[0].ChartData.SeriesList;
sc.RemoveAll();
ChartDataSeries s = sc.AddNewSeries();
s.X.DataField = "This_DateTime";
s.Y.DataField = "Device_Data";
C1WebChart2.ImageAreas.GetByName("ChartData").Tooltip = "值:{#YVAL},时间:{#XVAL}";
}
break;
case "光照度":
BLL.Light_Data b_Light = new Maticsoft.BLL.Light_Data();
ds = b_Light.GetList(0, _where, "This_DateTime");
C1WebChart1.Visible = true;
dt = ds.Tables[0];
if (dt != null)
{
C1WebChart1.DataSource = dt;
ChartDataSeriesCollection sc = this.C1WebChart1.ChartGroups[0].ChartData.SeriesList;
sc.RemoveAll();
ChartDataSeries s = sc.AddNewSeries();
s.X.DataField = "This_DateTime";
s.Y.DataField = "Device_Data";
C1WebChart1.ImageAreas.GetByName("ChartData").Tooltip = "值:{#YVAL},时间:{#XVAL}";
}
break;
case "温度":
BLL.temperature_Data b_Temp = new Maticsoft.BLL.temperature_Data();
ds = b_Temp.GetList(0, _where, "This_DateTime");
C1WebChart3.Visible = true;
dt = ds.Tables[0];
if (dt != null)
{
C1WebChart3.DataSource = dt;
ChartDataSeriesCollection sc = this.C1WebChart3.ChartGroups[0].ChartData.SeriesList;
sc.RemoveAll();
ChartDataSeries s = sc.AddNewSeries();
s.X.DataField = "This_DateTime";
s.Y.DataField = "Device_Data";
C1WebChart3.ImageAreas.GetByName("ChartData").Tooltip = "值:{#YVAL},时间:{#XVAL}";
}
break;
case "湿度":
BLL.Humidity_Data B_HU = new Maticsoft.BLL.Humidity_Data();
ds = B_HU.GetList(0, _where, "This_DateTime");
C1WebChart4.Visible = true;
dt = ds.Tables[0];
if (dt != null)
{
C1WebChart4.DataSource = dt;
ChartDataSeriesCollection sc = this.C1WebChart4.ChartGroups[0].ChartData.SeriesList;
sc.RemoveAll();
ChartDataSeries s = sc.AddNewSeries();
s.X.DataField = "This_DateTime";
s.Y.DataField = "Device_Data";
C1WebChart4.ImageAreas.GetByName("ChartData").Tooltip = "值:{#YVAL},时间:{#XVAL}";
}
break;
}
}