要過年了,還是把這個沒有研究好的東西總結一下吧!
在網上找到一個強人的VML做的漂亮的這些圖,確實不錯,但是一個頁面放一個圖確實可以,但我循環放多個圖就不行了!我只好把裡面的功能屏閉了一些,再加一點功能。才算是交了個差,但是沒原來那個酷了!
主要是裡面的VML那裡不太熟!年後再看看吧
代碼:
1:一個reportcontrol的.dll,這裡不能傳文件,暈
2:應用代碼:
這裡面的arraylist這個對象是一個item 元素的數組
public class Item
{
public Item(string text, int value)
{
this._text = text;
this._value = value;
}
private string _text;
public string Text
{
get
{
return _text;
}
}
private int _value;
public int Value
{
get
{
return _value;
}
}
}
private void BindDL(string thisCom_id ,string thisType)
{
string F0F1Str = this.GetCom_select(thisCom_id,thisType);
string F0Str = this.GetCom_select_F0_NO(F0F1Str);
if(F0Str != "")
{
string[] arr = F0Str.Split('','');
int height = 360;
int top = 50;
int j = 1;
for(int i=0 ;i<arr.Length;i++)
{
if(arr[i].ToString() != "")
{
string SQL= "select * from Spec_info where F0001="+int.Parse(arr[i].ToString());
SqlDataReader reader ;
reader = SqlHelper.ExecuteReader(MyConfig.MyConfigSectionHandler.ConnectionString,CommandType.Text ,SQL);
while(reader.Read())歡迎光臨學網,收藏本篇文章 [1] [2] [3]
$False$r /> {//這裡是要判斷在 Spec_info 中設定的其它不正常情況
}
reader.Close();
ArrayList arraylist = new ArrayList();
arraylist.Add(new Item("異常人數",int.Parse(GetTypeCount(arr[i].ToString(),"異常",this.Com_id,thisType))));
arraylist.Add(new Item("正常人數",int.Parse(GetTypeCount(arr[i].ToString(),"正常",this.Com_id,thisType))));
arraylist.Add(new Item("未檢人數",int.Parse(GetTypeCount(arr[i].ToString(),"未檢",this.Com_id,thisType))));
string panelID = "Panel"+j.ToString();
Chart(panelID,"1",arraylist,height,600,50,top,"<a href=''#'' onclick=''to("+arr[i].ToString()+")''>"+this.GetCate_Name(arr[i].ToString())+"</a>");
top=top+height+10;
j++;
//break;
//this.Panel1.Controls.Add(panel);
//dr["people_name"] = GetPeople_Name(arr[i].ToString(),"異常",this.Com_id);
}
}
}
}
private void Chart(string panel,string tag,ArrayList arraylist,int thisheight ,int thiswidth,int thisleft ,int thistop,string title)
{
WebChart chart = null;
if (tag == "1")
{
chart = new PIEChart();
//chart.Unit_total = "800";
文章整理:學網 http://www.xue5.com (本站) [1] [2] [3]
/> chart.ScriptUrl = "../../Scripts/pIEChart.JS";
}
else
{
chart = new ColumnChart();
//chart.Unit_total = "800";
chart.ScriptUrl = "../../Scripts/columnChart.JS";
}
chart.StyleFileUrl = "../../Scripts/WebChart.CSS";
chart.ReportTitle=title;
chart.DataSource = arraylist;
chart.DataTextFIEld = "Text";
chart.DataValueFIEld = "Value";
chart.Width = thiswidth;
chart.Height = thisheight;
chart.Left = thisleft;
chart.Top = thistop;
chart.DataBind();
//this.Panel1.Controls.Add(chart);
System.Web.UI.WebControls.Panel pan =(Panel)Page.FindControl(panel);
pan.Controls.Add(chart);
}
大概差不多了
我主要是做醫療的YLwebC裡面的 chart時用到,自己記得找
感謝網上的這兩位強人
http://www.cnblogs.com/Infinity/archive/2007/08/13/340941.Html (這個是JS的)
http://www.cnblogs.com/jmtek/archive/2006/02/23/336073.Html (這個是寫成了控件)