日期:2014-05-18  浏览次数:20462 次

请教在asp.net开发中的绘图问题?
我想在Asp.net制作的程序中,作几个根据数据库的数据动态绘制的图形(线形图、柱形图、饼形图等),各位帮忙推荐一下用什么方法比较好?

------解决方案--------------------
GDI+
------解决方案--------------------
很多,简单应用比较好的有FLASH的,OWC的。

------解决方案--------------------
用报表功能应该也可以
------解决方案--------------------
drawing
------解决方案--------------------
图表组件wsChart4.6(DLL版)
http://www.wave12.com/web/home.asp
------解决方案--------------------
还是用VML吧
------解决方案--------------------
OWC11下载网址
http://www.microsoft.com/downloads/details.aspx?familyid=7287252C-402E-4F72-97A5-E0FD290D4B76&displaylang=zh-cn
使用教程
http://blog.csdn.net/Eray/archive/2007/03/20/1534509.aspx
------解决方案--------------------
关注...
------解决方案--------------------
owc11簡單

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.Data.OleDb;
using Microsoft.Office.Interop.Owc11;

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string strName= "圖例1 ";
string strConn= "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= "+Server.MapPath( "App_Data/xxx.mdb ");
string strSql = "SELECT * FROM XX ";
OleDbConnection con = new OleDbConnection(strConn);
con.Open();
OleDbDataAdapter da = new OleDbDataAdapter(strSql, con);
DataSet ds = new DataSet();
da.Fill(ds);

string[] mon = new string[31];
string[] cnt = new string[31];
for(int i = 0; i < ds.Tables[0].Rows.Count;i++)
{
mon[i]=ds.Tables[0].Rows[i][0].ToString().Substring(9);
cnt[i]=ds.Tables[0].Rows[i][1].ToString();
}
string strX=string.Empty;
foreach(string strData in mon)
{
strX+=strData+ "\t ";
}
string strY=string.Empty;
foreach(string strValue in cnt)
{
strY+=strValue+ "\t ";
}
//創建ChartSpace來放置圖表
ChartSpace laySpace=new ChartSpace();
ChChart insertChart=laySpace.Charts.Add(0);
//insertChart.Type = ChartChartTypeEnum.chChartTypeArea;
//insertChart.Type = ChartChartTypeEnum.chChartTypeArea3D;
//insertChart.Type = ChartChartTypeEnum.chChartTypeBar3D;
//insertChart.Type=ChartChartTypeEnum.chChartTypeBarClustered;
//insertChart.Type = ChartChartTypeEnum.chChartTypeColumnClustered;
insertChart.Type = ChartChartTypeEnum.chChartTypeLine;
insertChart.HasLegend=false;//是否需要圖例
insertChart.HasTitle=true;
insertChart.Title.Caption= "2007年明晟消費表 ";

insertChart.Axes[0].HasTitle=true;
insertChart.Axes[0].Title.Caption= "日 ";//
insertChart.Axes[1].HasTitle=true;
insertChart.Axes[1].Title.Caption= "金額 ";//