VARCHART XGantt是一个交互式的甘特图控件,其模块化的设计让您可以创建满足您和您的客户所需求的应用程序。VARCHART XGantt可以快速、简单地集成到您的应用程序中,帮助您识别性能瓶颈、避免延迟以及高效利用资源,使复杂数据变得更加容易理解。
【VARCHART XGantt最新版免费下载】
想象一下,您的Gantt chart是按员工分组的,显示每位员工的资源负荷图表(直方图)。 在这种情况下,在直方图旁边显示员工的照片将为您的应用程序增添很大的视觉价值。
如何在.NET甘特图的直方图中显示图像
下面的屏幕截图让您了解我们想要实现的目标:将John,James和Jane的照片放在直方图旁边,这样您就可以立即(直观地)了解他们的工作量。

使用代码添加照片

在VcObjectDrawn事件中执行以下代码:
private void vcGantt1_VcObjectDrawn(object sender, VcObjectDrawnEventArgs e){Graphics g = e.Graphics;Bitmap myBM = null;switch (e.ObjectType){case VcObjectType.vcObjTypeNumericScale://Get the coordinates of a point in the numeric scaleint x = e.UpdateRect.Right - 5;int y = e.UpdateRect.Top + 5;//Identify in which histogram we areobject identObj = null;VcObjectType identObjType = VcObjectType.vcObjTypeNone;vcGantt1.IdentifyObjectAt(x, y, ref identObj, ref identObjType);VcHistogram histo = (VcHistogram)identObj;switch (histo.Name){case "A":myBM = new Bitmap(Application.StartupPath + @"....BitmapsImage1.png");//photo credit: kinojam via photopin ccbreak;case "B":myBM = new Bitmap(Application.StartupPath+ @"....BitmapsImage2.png");//photo credit: Enthuan via photopin ccbreak;case "C":myBM = new Bitmap(Application.StartupPath+ @"....BitmapsImage3.png");//photo credit: chris zerbes via photopin ccbreak;default:break;}//Draw the bitmaps in the numeric scales of the histogramsx = e.CompleteRect.Left + 50;y = e.CompleteRect.Top + e.CompleteRect.Height / 2 - 50;g.DrawImage(myBM, x, y, 80, 90);break;}}
希望这篇文章能对您有帮助~
想要购买VARCHART XGantt正版授权,或者获取更多该产品相关信息的朋友可以点击“咨询在线客服”
标签:
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!