翻譯|使用教程|編輯:王香|2018-11-29 10:01:14.000|閱讀 320 次
概述:您可以使用ASP.NET WebForm上的TeeChart WebChart通過ASP.NET連接數(shù)據(jù)源,其方式幾乎與數(shù)據(jù)源可以連接到WinForm上的TeeChart組件的方式相同。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關(guān)鏈接:
將TeeChart控件連接到ADO.NET數(shù)據(jù)庫可以在設(shè)計(jì)時(shí)使用TeeChart編輯器完成,并在運(yùn)行時(shí)使用幾行代碼完成。 任何Series都可以使用TeeChart Editor連接到ADO.NET表或查詢。每個(gè)系列都可以使用相同或不同的ADO.NET數(shù)據(jù)庫連接到相同或不同的表或查詢。 此設(shè)計(jì)為您提供了如何將圖表連接到數(shù)據(jù)庫的完全靈活性,因?yàn)槟粌H限于一個(gè)數(shù)據(jù)庫,也不僅限于一個(gè)表或查詢。 在設(shè)計(jì)時(shí)也會(huì)檢索數(shù)據(jù),因此您可以在開發(fā)期間查看實(shí)際數(shù)據(jù)。
上述設(shè)計(jì)時(shí)步驟可以用幾行代碼以編程方式重現(xiàn)。這使您可以更自由地控制數(shù)據(jù)庫操作。 每個(gè)Series都有“DataSource”屬性,它確定數(shù)據(jù)庫值的來源(表或查詢),以及“YValues.DataMember”和“LabelMember”屬性,以指定我們要繪制的字段。 將新的TeeChart for .Net對(duì)象拖到新項(xiàng)目和新表單上。
[C#]
using System.Data; using System.Data.OleDb; using System.Security; using System.Security.Permissions; private void Form1_Load(object sender, System.EventArgs e) { DataSet masterDatr myCurrencyManager; public void ConnectChartToTable() { myCurrencyManager = (CurrencyManager)this.BindingContext[sourceTable]; singleRecordSource1.RecordCurrency=myCurrencyManager; tChart1[0].CheckDataSource(); }
可以使用CurrencyManager導(dǎo)航表(和圖表)
private void MovePrevious() { if (myCurrencyManager.Position>0) { myCurrencyManager.Position=myCurrencyManager.Position+1; tChart1[0].CheckDataSource(); } } private void MoveNext() { if (myCurrencyManager.Position<myCurrencyManager.Count) { myCurrencyManager.Position=myCurrencyManager.Position+1; tChart1[0].CheckDataSource(); } }
您可以使用ASP.NET WebForm上的TeeChart WebChart通過ASP.NET連接數(shù)據(jù)源,其方式幾乎與數(shù)據(jù)源可以連接到WinForm上的TeeChart組件的方式相同。
購買TeeChart Pro AciveX正版授權(quán),請(qǐng)點(diǎn)擊“”喲!
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請(qǐng)務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請(qǐng)郵件反饋至chenjj@fc6vip.cn