4,818
社区成员
发帖
与我相关
我的任务
分享
private void Drawing(string type)
{
ch.Title = "学生成绩表"; //标题
ch.XName = "姓名"; //x轴名称
ch.YName = "成绩"; //y轴名称
ch.PicHight = 500;
ch.PicWidth = 700;
ch.PhaysicalImagePath = "NewStudentScore"; //图表存储地址
ch.FileName = "Statistics51aspx"; //图标存储命名
ch.SeriseName = "语文成绩"; //图例名称
//set(type);
da = new SqlData();//打开数据库
sql = new string[3];
string selected = "";
for (int i = 0; i < CheckBoxList1.Items.Count; i++)
{
if (CheckBoxList1.Items[i].Selected)
{
selected = CheckBoxList1.Items[i].Value.ToString();
sql[i] = "select name," + selected + " FROM StudentScore";
ds = da.ExecuteDateSet(sql[i]);
}
ch.DataSoure = ds.Tables[0];//产生DataTable
if (type == "Combo")
ch.CreateCombo(this.Chart1);
else if (type == "Pie")
ch.CreatePie(this.Chart1);
else if (type == "Line")
ch.CreateLine(this.Chart1);
}