翻譯|使用教程|編輯:楊鵬連|2020-09-16 11:06:36.767|閱讀 279 次
概述:VARCHART XGantt是一個(gè)交互式甘特圖組件,可生成清晰,靈活的甘特圖。本文介紹了 XGantt .NET為活動(dòng)和鏈接提供數(shù)據(jù)。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關(guān)鏈接:
甘特圖(Xgantt)從1998年的第一個(gè)商用版本開始就致力于計(jì)劃編制和項(xiàng)目管理方面控件的研究和開發(fā),經(jīng)過20多年的積累和沉淀,目前可為軟件開發(fā)商和最終用戶提供最頂級(jí)的計(jì)劃編制和項(xiàng)目管理的控件產(chǎn)品,幫助用戶快速的整合項(xiàng)目管理軟件所需的甘特圖,網(wǎng)絡(luò)圖,資源柱狀圖,日程日歷,資源調(diào)度等功能模塊,并提供全方位的支持和服務(wù)。
VARCHART XGantt是一款功能強(qiáng)大的甘特圖控件,其模塊化的設(shè)計(jì)讓您可以創(chuàng)建滿足需要的應(yīng)用程序。XGantt可用于.NET,ActiveX和ASP.NET應(yīng)用程序,可以快速、簡單地集成到您的應(yīng)用程序中,幫助您識(shí)別性能瓶頸、避免延遲以及高效利用資源,使復(fù)雜數(shù)據(jù)變得更加容易理解。
與時(shí)間和資源相關(guān)的計(jì)劃數(shù)據(jù),例如工作,任務(wù),訂單,活動(dòng)和能力,最好在甘特圖中顯示。
在智能甘特圖中,計(jì)劃者可以隨時(shí)采取糾正措施。
加速您的開發(fā)并創(chuàng)建引人注目的、易于使用的可視化調(diào)度體驗(yàn)。VARCHART XGantt在市場上已有近30年的歷史,它提供了最完善的C#Gantt圖表控件,可用于構(gòu)建現(xiàn)代而又可靠的行業(yè)資源調(diào)度應(yīng)用程序。
為了顯示活動(dòng)和鏈接,VARCHART XGantt需要提供數(shù)據(jù)。默認(rèn)情況下,對(duì)于關(guān)聯(lián)的通信使用兩個(gè)表:
1. NodeTable(也稱為Maindata)
2. 鏈接表(LinkTable)(也稱為關(guān)系)
在表單中放置VARCHART XGantt時(shí),已經(jīng)預(yù)先提供了基本字段。
Maindata數(shù)據(jù)表的字段:
關(guān)系數(shù)據(jù)表的字段:
如果需要比默認(rèn)定義的表更多的表,可以在單擊屬性頁General上啟用的擴(kuò)展數(shù)據(jù)表之后,在“管理數(shù)據(jù)表”對(duì)話框的上部部分創(chuàng)建它們。
這可以通過使用對(duì)象類型VcDataRecordCollection的方法Add(…)來完成。EndLoading方法完成要組成的對(duì)應(yīng)圖表的數(shù)據(jù)輸入。為此,請(qǐng)?jiān)诒韱蔚募虞d事件中輸入以下代碼行。
示例代碼VB.NET
Dim dataTable As VcDataTable Dim dataRecCltn As VcDataRecordCollection VcGantt1.ExtendedDataTablesEnabled = True dataTable = VcGantt1.DataTableCollection.DataTableByName("Maindata") dataRecCltn = dataTable.DataRecordCollection dataRecCltn.Add("1;Node 1;07.05.2010;;5") dataRecCltn.Add("2;Node 2;14.05.2010;;5") dataRecCltn.Add("3;Node 3;21.05.2010;;5") dataTable = VcGantt1.DataTableCollection.DataTableByName("Relations") dataRecCltn = dataTable.DataRecordCollection dataRecCltn.Add("1;1;2") dataRecCltn.Add("2;2;3") VcGantt1.EndLoadingc#示例代碼
vcGantt1.ExtendedDataTablesEnabled = true; VcDataTable dataTable = vcGantt1.DataTableCollection.DataTableByName("Maindata"); VcDataRecordCollection dataRecCltn = dataTable.DataRecordCollection; dataRecCltn.Add("1;Node 1;07.05.2010;;5"); dataRecCltn.Add("2;Node 2;14.05.2010;;5"); dataRecCltn.Add("3;Node 3;21.05.2010;;5"); dataTable = vcGantt1.DataTableCollection.DataTableByName("Relations"); dataRecCltn = dataTable.DataRecordCollection; dataRecCltn.Add("1;1;2"); dataRecCltn.Add("2;2;3"); vcGantt1.EndLoading;記錄中的值用分號(hào)分隔。字段的順序必須與數(shù)據(jù)定義中字段的順序相對(duì)應(yīng)。新記錄必須有明確的標(biāo)識(shí),而不是空的。記錄中的日期必須與數(shù)據(jù)定義表中的DateFormat定義相對(duì)應(yīng)。對(duì)持續(xù)時(shí)間的解釋取決于時(shí)間單位的設(shè)置。它被預(yù)先設(shè)置為天,你可以在一般屬性頁面上修改。
對(duì)于表格和通用屬性頁上的每個(gè)對(duì)話框,日期輸出格式的定義一致。
或者,您也可以從CSV文件加載數(shù)據(jù)。文件的結(jié)構(gòu)必須符合以下方案:
示例代碼
1;Node 1;07.05.2010;;5; 2;Node 2;14.05.2010;;5; 3;Node 3;21.05.2010;;5; * * * * 1; 1; 2; 2、2、3;每個(gè)記錄都有自己的行。這些行的內(nèi)容對(duì)應(yīng)于對(duì)象類型的方法Add(…)傳遞的參數(shù)
首先列出Maindata數(shù)據(jù)表的記錄,然后列出關(guān)系數(shù)據(jù)表的記錄。使用表名****來標(biāo)記記錄組的開始。
例如,如果您以intro的名稱保存這類文件。csv,你可以導(dǎo)入數(shù)據(jù)如下:
示例代碼VB.NET
VcGantt1.Open("c:\intro.csv") Example Code C# vcGantt1.Open(@"c:\intro.csv");指定所表示的時(shí)間段
到目前為止,您將看不到任何活動(dòng),因?yàn)闀r(shí)間尺度還沒有調(diào)整到相應(yīng)的時(shí)期。時(shí)間尺度的顯示范圍可以通過屬性TimeScaleStart和TimeScaleEnd定義,或者通過對(duì)象VcGantt的OptimizeTimeScaleStartEnd(…)方法從數(shù)據(jù)中確定。
Example Code VB.NET
VcGantt1.TimeScaleEnd = New DateTime(2011, 1, 1) VcGantt1.TimeScaleStart = New DateTime(2010, 5, 4)Example Code C#
vcGantt1.TimeScaleEnd = new DateTime(2011,1,1); vcGantt1.TimeScaleStart =new DateTime(2010,5,4);下面是我們的初始示例所需要的代碼。
Example Code VB.NET
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load VcGantt1.Width = ClientSize.Width - VcGantt1.Left VcGantt1.Height = ClientSize.Height - VcGantt1.Top Dim dataTable As VcDataTable Dim dataRecCltn As VcDataRecordCollection vcGantt1.ExtendedDataTablesEnabled = True dataTable = VcGantt1.DataTableCollection.DataTableByName("Maindata") dataRecCltn = dataTable.DataRecordCollection dataRecCltn.Add("1;Node 1;03.05.2010;;5") dataRecCltn.Add("2;Node 2;08.05.2010;;5") dataRecCltn.Add("3;Node 3;15.05.2010;;5") dataTable = VcGantt1.DataTableCollection.DataTableByName("Relations") dataRecCltn = dataTable.DataRecordCollection dataRecCltn.Add("1;1;2") dataRecCltn.Add("2;2;3") VcGantt1.EndLoading() VcGantt1.OptimizeTimeScaleStartEnd(3) End Sub Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Resize VcGantt1.Width = ClientSize.Width - VcGantt1.Left VcGantt1.Height = ClientSize.Height - VcGantt1.Top End SubExample Code C#
private void Form1_Load(object sender, System.EventArgs e) { vcGantt1.Width = ClientSize.Width - vcGantt1.Left; vcGantt1.Height = ClientSize.Height - vcGantt1.Top; vcGantt1.ExtendedDataTablesEnabled = true; VcDataTable dataTable = vcGantt1.DataTableCollection.DataTableByName("Maindata"); VcDataRecordCollection dataRecCltn = dataTable.DataRecordCollection; dataRecCltn.Add("1;Node 1;03.05.2010;;5"); dataRecCltn.Add("2;Node 2;08.05.2010;;5"); dataRecCltn.Add("3;Node 3;15.05.2010;;5"); dataTable = vcGantt1.DataTableCollection.DataTableByName("Relations"); dataRecCltn = dataTable.DataRecordCollection; dataRecCltn.Add("1;1;2"); dataRecCltn.Add("2;2;3"); vcGantt1.EndLoading(); vcGantt1.OptimizeTimeScaleStartEnd(3); } private void Form1_Resize(object sender, System.EventArgs e) { vcGantt1.Width = ClientSize.Width - vcGantt1.Left; vcGantt1.Height = ClientSize.Height - vcGantt1.Top;如果您現(xiàn)在運(yùn)行該程序,結(jié)果應(yīng)該如下圖所示。
APS幫助提升企業(yè)生產(chǎn)效率,真正實(shí)現(xiàn)生產(chǎn)計(jì)劃可視化呈現(xiàn)與控制,快速有效響應(yīng)不同場景的生產(chǎn)計(jì)劃,提高準(zhǔn)時(shí)交貨能力,提高產(chǎn)能和資源利用率
想要了解甘特圖或慧都APS系統(tǒng),請(qǐng)登錄慧都網(wǎng),解決您的問題!
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請(qǐng)務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請(qǐng)郵件反饋至chenjj@ke049m.cn
文章轉(zhuǎn)載自: