日期:2014-05-17 浏览次数:20374 次
//自己写的一个画图方法
public void DrawCurve(Page page, DataSet ds, int sum)
{
#region 图片的设置
//获取记录数量
int count = ds.Tables[0].Rows.Count;
int wd = 80 + 20 * (count - 1);
if (wd < 800)
//{
wd = 800;// }
Bitmap img = new Bitmap(wd, 800);
Graphics g = Graphics.FromImage(img);
Pen Bp = new Pen(Color.Black);
Pen Rp = new Pen(Color.Red);
Pen Sp = new Pen(Color.Silver);
Font BigTitleFont = new Font("Arial", 12, FontStyle.Bold);
Font NomalFont = new Font("Arial", 6);
Font BigFont = new Font("Arial", 9);
#endregion
g.DrawRectangle(new Pen(Color.White, 400), 0, 0, img.Width, img.Height);
//画标题的brush
LinearGradientBrush brush = new LinearGradientBrush(new Rectangle(0, 0, img.Width, img.Height), Color.Black, Color.Black, 1.2F, true);
LinearGradientBrush Bluebrush = new LinearGradientBrush(new Rectangle(0, 0, img.Width, img.Height), Color.Blue, Color.Blue, 1.2F, true);
//绘制大标题
string bigtitle = "历史记录曲线图";
g.DrawString(bigtitle, BigTitleFont, brush, 40, 5);
//取得当前发送量
double nums = 0;
for (int i = 0; i < co