翻譯|使用教程|編輯:黃竹雯|2018-12-13 12:31:19.000|閱讀 346 次
概述:本文主要介紹VARCHART XGantt系列教程之如何用值來標(biāo)記曲線,內(nèi)附效果圖和下載鏈接。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關(guān)鏈接:
VARCHART XGantt是一款功能強(qiáng)大的甘特圖控件。其模塊化的設(shè)計(jì)讓您可以創(chuàng)建滿足您和您的客戶所需求的應(yīng)用程序(我們領(lǐng)先的甘特圖控件VARCHART XGantt可用于.NET,ActiveX和ASP.NET應(yīng)用程序)。VARCHART XGantt可以快速、簡單地集成到您的應(yīng)用程序中,幫助您識(shí)別性能瓶頸、避免延遲以及高效利用資源,使復(fù)雜數(shù)據(jù)變得更加容易理解。
如果您使用Gantt Charts來進(jìn)行資源控制,那么您通常會(huì)對當(dāng)前情況有一個(gè)清晰和精確的概述感興趣。特別是在某些事情似乎不怎么明了的情況下,您需要立即看到問題。介于此本文旨在講述如何使用值來標(biāo)記曲線,供大家學(xué)習(xí)討論。
詳細(xì)的規(guī)劃不僅需要用直方圖來表示資源,而且還需要顯示資源利用率的準(zhǔn)確值,以便能夠快速識(shí)別資源瓶頸。
使用的一個(gè)生動(dòng)的例子是精確控制機(jī)器部件數(shù)量的生產(chǎn)計(jì)劃,由于一個(gè)或多個(gè)直方圖的高度復(fù)雜性,這些直方圖具有許多值的堆疊曲線,在許多情況下會(huì)導(dǎo)致空間不足,從而妨礙標(biāo)簽的可讀性,因此不能在其中標(biāo)記曲線。如果應(yīng)用程序中只顯示少量且很少更改的值,從而在x方向上為標(biāo)簽留出足夠的空間,則可以通過放置在直方圖下方的第二個(gè)VARCHART XGantt實(shí)例獲得曲線標(biāo)簽。
在我們的示例中,甘特圖是由VARCHART XGantt ActiveX創(chuàng)建的。機(jī)器的容量由部件的數(shù)量來衡量,與計(jì)劃的部件數(shù)量一起顯示(第一個(gè)數(shù)字一般表示利用率,第二個(gè)數(shù)字表示資源的最大可用性):
直方圖顯示了資源調(diào)度器在8點(diǎn)時(shí)計(jì)算出的20個(gè)片和9點(diǎn)時(shí)計(jì)算出的10個(gè)片的分布,因此,9點(diǎn)10件的可用容量很容易識(shí)別。
當(dāng)組布局切換到“All nodes in one row”和“Nodes optimized”時(shí),標(biāo)簽將在正確的位置繪制。使用以下代碼創(chuàng)建標(biāo)簽:
Dim currentDate As Date Dim histogram As VcHistogram Dim capacityCurve As VcCurve Dim loadCurve As VcCurve Dim leftDate As Date Dim rightDate As Date Dim leftValue1 As Long Dim leftValue2 As Long Dim rightValue As Long Dim cal As VcCalendar 'Reset second XGantt (only necessary if switching between several curves is possible) VcGantt2.Reset vcRemoveNodes 'Calculate necessary objects Set cal = VcGantt1.CalendarCollection.Active Set histogram = VcGantt1.HistogramCollection.HistogramByName _ (histogramName) Set capacityCurve = histogram.CurveCollection.CurveByName(histogramName) Set loadCurve = histogram.CurveCollection.CurveByName _ ("Load_" + histogramName) 'Create nodes in a loop over the time displayed currentDate = VcGantt1.TimeScaleStart Do While currentDate < VcGantt2.TimeScaleEnd 'Read curves Call capacityCurve.GetValues(d, leftDate, leftValue1, _ rightDate, rightValue) Call loadCurve.GetValues(d, leftDate, leftValue2, _ rightDate, rightValue) 'create node for second XGantt with Node-ID, 2 values, group name = 'histogram name, start and end date VcGantt2.InsertNodeRecord CStr(d) + ";" + _ CStr(leftValue2) + "/" + _ CStr(leftValue2) + "/" + _ histogramName + ";" + _ normDat(d) + ";" + _ normDat(DateAdd("h", 1, d)) 'calculate next start date (at the end of a working day moving forward to 'the beginning of the next working day) currentDate = cal.AddDuration(currentDate, 1) If Hour(currentDate) = 17 Then currentDate = cal.AddDuration(cal.AddDuration(currentDate, 1), -1) End If Loop 'import all nodes to the Gantt diagram VcGantt2.EndLoading 'Perform grouping again VcGantt2.GroupNodes True
更多VARCHART XGantt系列教程將在后續(xù)更新,敬請關(guān)注~
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請郵件反饋至chenjj@fc6vip.cn