利用EXCEL可以比较轻松的搞定,建议学一下EXCEL的数据透视表,挺方便的。其可以连外部数据库,访问SQL数据库提取数据即可生成图表。
⑵ 从SQL读到的数据怎么把数据显示成趋势图
用UNION,要求列数一样,可以显示多条例:SELECT 1,2UNIONSELECT 1,4
⑶ SQL如何计算趋势增长
根据数据库文件每个月的增长量,计算出数据库的增长率。
请按照此思路操作。
⑷ sql server报表生成器怎么生成折线图
这个可以用多种方式来做,以两种方式为例说明一下: 1、读取数据库,得到数据集,绑定对应列得到折线图: DataSet ds = 读取数据库; DataView dv=new DataView(ds.Tables[0]); this.chart1.Series[0].ChartType=SeriesChartType.Line; this.char...
⑸ js 读数sql数据并画曲线 有谁会呢帮个忙,给个源码呗~~~~
不知道你的数据是怎么样的.
我这里有个简单的,没用js,直接用asp输出的,方法可以参考.
http://shirne.com/stat.asp
⑹ 利用sql sever能生成曲线 柱形图
本身sql server不提供绘制表格图形吧, 你需要编程读出数据库的数据,然后根据自己的需要绘制曲线/柱形图/饼形图等等.
sql server也只是存储数据.
⑺ 请问我想用 C#编写程序,用图形曲线图的形式显示数据的变化的趋势,数据库是sql server,请大家给意见。
有一种控件,DevExperss,里面有线型数据图、柱型图等等,甚至还有3D数据视图,你可以试试看,使用比较简单
⑻ php生成曲线图,mysql语句怎么写
select recharge_time,sum(menoy) from tab_a group by recharge_time
⑼ 怎样通过SQL SERVER中的数据,用曲线的形式形成一个数学曲线统计图呢
可以使用报表连接数据库实现
ireport是个不错的选择
⑽ 在vb中,怎么实现读取SQL2005中的数据,把它绘出曲线图呢
using System;
using System.Data;
using System.Configuration;
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 System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.Drawing;
using System.IO;
/**//// <summary>
/// DrawClass 的摘要说明
/// </summary>
public class DrawClass
...{
public DrawClass()
...{
//
// TODO: 在此处添加构造函数逻辑
//
}
public MemoryStream draw(DataSet ds, int Tnum)
...{
//取得记录数量
int count = ds.Tables[0].Rows.Count;
//记算图表宽度
int wd = 80 + 20 * (count - 1);
//设置最小宽度为800
if (wd < 800) wd = 800;
//生成Bitmap对像
Bitmap img = new Bitmap(wd, 400);
//生成绘图对像
Graphics g = Graphics.FromImage(img);
//定义黑色画笔
Pen Bp = new Pen(Color.Black);
//定义红色画笔
Pen Rp = new Pen(Color.Red);
//定义银灰色画笔
Pen Sp = new Pen(Color.Silver);
//定义大标题字体
Font Bfont = new Font("Arial", 12, FontStyle.Bold);
//定义一般字体
Font font = new Font("Arial", 6);
//定义大点的字体
Font Tfont = new Font("Arial", 9);
//绘制底色
g.DrawRectangle(new Pen(Color.White, 400), 0, 0, img.Width, img.Height);
//定义黑色过渡型笔刷
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);
//绘制大标题
g.DrawString(ds.Tables[0].Rows[0]["sendid"].ToString() + "号订单发送情况曲线图", Bfont, brush, 40, 5);
//取得当前发送量
int nums = 0;
for (int i = 0; i < count; i++)
...{
nums += Convert.ToInt32(ds.Tables[0].Rows[i]["sendmum"]);
}
//绘制信息简报
string info = "订单发送时间:" + ds.Tables[0].Rows[0]["sendtime"].ToString() + " 曲线图生成时间:" + DateTime.Now.ToString() + " 订单总量:" + Tnum.ToString() + " 当前发送总量:" + nums.ToString();
g.DrawString(info, Tfont, Bluebrush, 40, 25);
//绘制图片边框
g.DrawRectangle(Bp, 0, 0, img.Width - 1, img.Height - 1);
//绘制竖坐标线
for (int i = 0; i < count; i++)
...{
g.DrawLine(Sp, 40 + 20 * i, 60, 40 + 20 * i, 360);
}
//绘制时间轴坐标标签
for (int i = 0; i < count; i += 2)
...{
string st = Convert.ToDateTime(ds.Tables[0].Rows[i]["sendtime"]).ToString("hh:mm");
g.DrawString(st, font, brush, 30 + 20 * i, 370);
}
//绘制横坐标线
for (int i = 0; i < 10; i++)
...{
g.DrawLine(Sp, 40, 60 + 30 * i, 40 + 20 * (count - 1), 60 + 30 * i);
int s = 2500 - 50 * i * 5;
//绘制发送量轴坐标标签
g.DrawString(s.ToString(), font, brush, 10, 60 + 30 * i);
}
//绘制竖坐标轴
g.DrawLine(Bp, 40, 55, 40, 360);
//绘制横坐标轴
g.DrawLine(Bp, 40, 360, 45 + 20 * (count - 1), 360);
//定义曲线转折点
Point[] p = new Point[count];
for (int i = 0; i < count; i++)
...{
p[i].X = 40 + 20 * i;
p[i].Y = 360 - Convert.ToInt32(ds.Tables[0].Rows[i]["sendmum"]) / 5 * 3 / 5;
}
//绘制发送曲线
g.DrawLines(Rp, p);
for (int i = 0; i < count; i++)
...{
//绘制发送记录点的发送量
g.DrawString(ds.Tables[0].Rows[i]["sendmum"].ToString(), font, Bluebrush, p[i].X, p[i].Y - 10);
//绘制发送记录点
g.DrawRectangle(Rp, p[i].X - 1, p[i].Y - 1, 2, 2);
}
//绘制竖坐标标题
g.DrawString("发送量", Tfont, brush, 5, 40);
//绘制横坐标标题
g.DrawString("发送时间", Tfont, brush, 40, 385);
//保存绘制的图片
MemoryStream stream = new MemoryStream();
img.Save(stream, ImageFormat.Jpeg);
return stream;
}
}
然后在页面文件中调用输出
DrawClass dc = new DrawClass();
OracleConnection conn = new OracleConnection(con);
string sql = "select * from atest";
OracleDataAdapter da = new OracleDataAdapter(sql, conn);
DataSet ds = new DataSet();
da.Fill(ds, "atest");
MemoryStream ss=dc.draw(ds, 6);
Response.ContentType = "image/jpeg";
Response.BinaryWrite(ss.ToArray());
图片输出到page页面中也有另外一种方式
FileStream fs = new FileStream(@"c:Curve.jpg", FileMode.Open, FileAccess.Read);
byte[] mydata = new byte[fs.Length];
int Length = Convert.ToInt32(fs.Length);
fs.Read(mydata, 0, Length);
fs.Close();
this.Response.OutputStream.Write(mydata, 0, Length);
this.Response.End();