dotnetCharting使用问题

蓝欣紫梦 2013-07-09 04:39:42

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);
}

无论我多选还是单选,图表里显示组数一定是CheckBoxList1的总项数,怎么改呀
...全文
579 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
蓝欣紫梦 2013-07-09
  • 打赏
  • 举报
回复
谢谢,刚刚问题解决了
一步一码 2013-07-09
  • 打赏
  • 举报
回复
帮你顶一下

4,818

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 图表区
社区管理员
  • 图表区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧