利用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();