asp.net 中用chart控件画折线图 asp.netchart控件数据库 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用HighCharts吧附上使用指南 http://blog.csdn.net/wocaonima123987/article/details/8198673 http://down.chinaz.com/soft/25600.htmhttp://www.microsoft.com/en-us/download/details.aspx?id=14422 能不能就我上面所说的帮我做一个啊!我是用的vs2010中的asp.net。里面有自带的控件chart控件做的。大神帮帮忙啊!!!!!(对了。我希望是有2个人的几组数据,不是只有一个人的,这样,点击一个人的,就显示那一个人的数据,点击另外一个人,就显示另外一个人的数据。大神急求!!) 我的qq:2280878911大神可以联系我这个qq!在线的!求帮忙 asp.net绘制网站流量折线图 //绘制网站流量统计图 private void DrawLine() { int height = 397, width = 560; System.Drawing.Bitmap image = new System.Drawing.Bitmap(width, height); Graphics g = Graphics.FromImage(image); //清空图片背景色 g.Clear(Color.White); Font font = new System.Drawing.Font("Arial", 9, FontStyle.Regular); Font font1 = new System.Drawing.Font("宋体", 20, FontStyle.Regular); Font font2 = new System.Drawing.Font("Arial", 8, FontStyle.Regular); System.Drawing.Drawing2D.LinearGradientBrush brush = new System.Drawing.Drawing2D.LinearGradientBrush(new Rectangle(0, 0, image.Width, image.Height), Color.Blue, Color.Blue, 1.2f, true); g.FillRectangle(Brushes.AliceBlue, 0, 0, width, height); Brush brush1 = new SolidBrush(Color.Blue); Brush brush2 = new SolidBrush(Color.SaddleBrown); string str = "SELECT * FROM 访问量表 WHERE ShowYear=2007"; Con = new SqlConnection(strconn); Con.Open(); Com = new SqlCommand(str, Con); dr = Com.ExecuteReader(); dr.Read(); if (dr.HasRows) { g.DrawString("2007年各月份网站访问人数", font1, brush1, new PointF(130, 30)); } dr.Close(); //画图片的边框线 g.DrawRectangle(new Pen(Color.Blue), 0, 0, image.Width - 1, image.Height - 1); Pen mypen = new Pen(brush, 1); Pen mypen2 = new Pen(Color.Red, 2); //绘制线条 //绘制纵向线条 int x = 60; for (int i = 0; i < 12; i++) { g.DrawLine(mypen, x, 80, x, 340); x = x + 40; } Pen mypen1 = new Pen(Color.Blue, 2); g.DrawLine(mypen1, x - 480, 80, x - 480, 340); //绘制横向线条 int y = 106; for (int i = 0; i < 9; i++) { g.DrawLine(mypen, 60, y, 540, y); y = y + 26; } g.DrawLine(mypen1, 60, y, 540, y); //x轴 String[] n = {" 一月", " 二月", " 三月", " 四月", " 五月", " 六月", " 七月", " 八月", " 九月", " 十月", "十一月", "十二月"}; x = 35; for (int i = 0; i < 12; i++) { g.DrawString(n[i].ToString(), font, Brushes.Red, x, 348); //设置文字内容及输出位置 x = x + 40; } //y轴 String[] m = {"4500人", "4000人", "3500人", "3000人", "2500人", "2000人", "1500人", "1000人", "500人"}; y = 100; for (int i = 0; i < 9; i++) { g.DrawString(m[i].ToString(), font, Brushes.Red, 10, y); //设置文字内容及输出位置 y = y + 26; } int[] Count = new int[12]; string[] NumChr = new string[12]; Da = new SqlDataAdapter(); Da.SelectCommand = Com; ds = new DataSet(); Da.Fill(ds); for (int i = 0; i < 12; i++) { NumChr[i] = ds.Tables[0].Rows[0][i + 1].ToString(); } for (int j = 0; j < 12; j++) { Count[j] = Convert.ToInt32(NumChr[j].ToString()) * 26 / 500; } //显示折线效果 SolidBrush mybrush = new SolidBrush(Color.Red); Point[] points = new Point[12]; points[0].X = 60; points[0].Y = 340 - Count[0]; points[1].X = 100; points[1].Y = 340 - Count[1]; points[2].X = 140; points[2].Y = 340 - Count[2]; points[3].X = 180; points[3].Y = 340 - Count[3]; points[4].X = 220; points[4].Y = 340 - Count[4]; points[5].X = 260; points[5].Y = 340 - Count[5]; points[6].X = 300; points[6].Y = 340 - Count[6]; points[7].X = 340; points[7].Y = 340 - Count[7]; points[8].X = 380; points[8].Y = 340 - Count[8]; points[9].X = 420; points[9].Y = 340 - Count[9]; points[10].X = 460; points[10].Y = 340 - Count[10]; points[11].X = 500; points[11].Y = 340 - Count[11]; g.DrawLines(mypen2, points); //绘制折线 image.Save(Server.MapPath("网站流量统计图.gif")); g.Dispose(); image.Dispose(); Image1.ImageUrl = "~/网站流量统计图.gif"; } 发布到服务器后,WORD组件无法使用,报80070005 拒绝访问错误。 asp.net调用外部应用程序时间设置 菜鸟小白求教------- ajax 刷新问题 Gridview下的DropDownList问题,很郁闷. Detailsview 编辑模式下 模版里有个listbox 要初始化 在login之后转到用户的个人信息页面,但如何在登陆以后的页面是注册用户的身份呢? 乱码的问题 这个需求ASP.NET页继承可以实现吗? ASP.NET水晶报表传参出错了406 (Not Acceptable) ASP.NET MVC的一个简单问题 大文件上传
附上使用指南 http://blog.csdn.net/wocaonima123987/article/details/8198673
http://www.microsoft.com/en-us/download/details.aspx?id=14422
大神可以联系我这个qq!在线的!求帮忙
//绘制网站流量统计图
private void DrawLine()
{
int height = 397, width = 560;
System.Drawing.Bitmap image = new System.Drawing.Bitmap(width, height);
Graphics g = Graphics.FromImage(image);
//清空图片背景色
g.Clear(Color.White); Font font = new System.Drawing.Font("Arial", 9, FontStyle.Regular);
Font font1 = new System.Drawing.Font("宋体", 20, FontStyle.Regular);
Font font2 = new System.Drawing.Font("Arial", 8, FontStyle.Regular); System.Drawing.Drawing2D.LinearGradientBrush brush = new System.Drawing.Drawing2D.LinearGradientBrush(new Rectangle(0, 0, image.Width, image.Height), Color.Blue, Color.Blue, 1.2f, true);
g.FillRectangle(Brushes.AliceBlue, 0, 0, width, height);
Brush brush1 = new SolidBrush(Color.Blue);
Brush brush2 = new SolidBrush(Color.SaddleBrown); string str = "SELECT * FROM 访问量表 WHERE ShowYear=2007";
Con = new SqlConnection(strconn);
Con.Open();
Com = new SqlCommand(str, Con);
dr = Com.ExecuteReader();
dr.Read();
if (dr.HasRows)
{
g.DrawString("2007年各月份网站访问人数", font1, brush1, new PointF(130, 30));
}
dr.Close();
//画图片的边框线
g.DrawRectangle(new Pen(Color.Blue), 0, 0, image.Width - 1, image.Height - 1); Pen mypen = new Pen(brush, 1);
Pen mypen2 = new Pen(Color.Red, 2);
//绘制线条
//绘制纵向线条
int x = 60;
for (int i = 0; i < 12; i++)
{
g.DrawLine(mypen, x, 80, x, 340);
x = x + 40;
}
Pen mypen1 = new Pen(Color.Blue, 2);
g.DrawLine(mypen1, x - 480, 80, x - 480, 340); //绘制横向线条
int y = 106;
for (int i = 0; i < 9; i++)
{
g.DrawLine(mypen, 60, y, 540, y);
y = y + 26;
}
g.DrawLine(mypen1, 60, y, 540, y); //x轴
String[] n = {" 一月", " 二月", " 三月", " 四月", " 五月", " 六月", " 七月",
" 八月", " 九月", " 十月", "十一月", "十二月"};
x = 35;
for (int i = 0; i < 12; i++)
{
g.DrawString(n[i].ToString(), font, Brushes.Red, x, 348); //设置文字内容及输出位置
x = x + 40;
} //y轴
String[] m = {"4500人", "4000人", "3500人", "3000人", "2500人", "2000人", "1500人", "1000人",
"500人"};
y = 100;
for (int i = 0; i < 9; i++)
{
g.DrawString(m[i].ToString(), font, Brushes.Red, 10, y); //设置文字内容及输出位置
y = y + 26;
} int[] Count = new int[12];
string[] NumChr = new string[12];
Da = new SqlDataAdapter();
Da.SelectCommand = Com;
ds = new DataSet();
Da.Fill(ds);
for (int i = 0; i < 12; i++)
{
NumChr[i] = ds.Tables[0].Rows[0][i + 1].ToString();
}
for (int j = 0; j < 12; j++)
{
Count[j] = Convert.ToInt32(NumChr[j].ToString()) * 26 / 500;
} //显示折线效果
SolidBrush mybrush = new SolidBrush(Color.Red);
Point[] points = new Point[12];
points[0].X = 60; points[0].Y = 340 - Count[0];
points[1].X = 100; points[1].Y = 340 - Count[1];
points[2].X = 140; points[2].Y = 340 - Count[2];
points[3].X = 180; points[3].Y = 340 - Count[3];
points[4].X = 220; points[4].Y = 340 - Count[4];
points[5].X = 260; points[5].Y = 340 - Count[5];
points[6].X = 300; points[6].Y = 340 - Count[6];
points[7].X = 340; points[7].Y = 340 - Count[7];
points[8].X = 380; points[8].Y = 340 - Count[8];
points[9].X = 420; points[9].Y = 340 - Count[9];
points[10].X = 460; points[10].Y = 340 - Count[10];
points[11].X = 500; points[11].Y = 340 - Count[11];
g.DrawLines(mypen2, points); //绘制折线
image.Save(Server.MapPath("网站流量统计图.gif"));
g.Dispose();
image.Dispose();
Image1.ImageUrl = "~/网站流量统计图.gif";
}