VARCHART XGantt是一款功能强大的甘特图控件。其模块化的设计让您能够建立知足您和您的客户所需求的应用程序(咱们领先的甘特图控件VARCHART XGantt可用于.NET,ActiveX和ASP.NET应用程序)。VARCHART XGantt能够快速、简单地集成到您的应用程序中,帮助您识别性能瓶颈、避免延迟以及高效利用资源,使复杂数据变得更加容易理解。node
若是您使用Gantt Charts来进行资源控制,那么您一般会对当前状况有一个清晰和精确的概述感兴趣。特别是在某些事情彷佛不怎么明了的状况下,您须要当即看到问题。介于此本文旨在讲述如何使用值来标记曲线,供你们学习讨论。模块化
详细的规划不只须要用直方图来表示资源,并且还须要显示资源利用率的准确值,以便可以快速识别资源瓶颈。oop
使用的一个生动的例子是精确控制机器部件数量的生产计划,因为一个或多个直方图的高度复杂性,这些直方图具备许多值的堆叠曲线,在许多状况下会致使空间不足,从而妨碍标签的可读性,所以不能在其中标记曲线。若是应用程序中只显示少许且不多更改的值,从而在x方向上为标签留出足够的空间,则能够经过放置在直方图下方的第二个VARCHART XGantt实例得到曲线标签。布局
在咱们的示例中,甘特图是由VARCHART XGantt ActiveX建立的。机器的容量由部件的数量来衡量,与计划的部件数量一块儿显示(第一个数字通常表示利用率,第二个数字表示资源的最大可用性):性能
【直方图中生产计划显示利用率】学习
直方图显示了资源调度器在8点时计算出的20个片和9点时计算出的10个片的分布,所以,9点10件的可用容量很容易识别。spa
当组布局切换到“All nodes in one row”和“Nodes optimized”时,标签将在正确的位置绘制。使用如下代码建立标签:设计
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系列教程将在后续更新,敬请关注~orm
查看文章转载原文请点击这里。blog