using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using BLL;
using Models;
public partial class GridViewDemo_BZImage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
GetBZIamge();
}
/// <summary>
/// 生成饼状柱状图
/// </summary>
public void GetBZIamge()
{
DataTable dt = BLL.StudentBLL.SelAllStudent();
string[] rows = new string[dt.Rows.Count];
int[] columns = new int[dt.Rows.Count];
for (int i = 0; i < dt.Rows.Count; i++)
{
rows[i] = dt.Rows[i]["学生姓名"].ToString();
columns[i] = Convert.ToInt32(dt.Rows[i]["薪金"].ToString());
}
Tools.OWCImageHelp.GetZBImage(rows, columns, "学生薪水查询");
}
}
三、显示饼状柱状图的页面:
前台:
复制代码 代码如下: