甘特图属于甘特系列浏览次数(也称为时间或时间轴图表)。此视图显示横条沿时间轴。每个条形代表一个单独的事件的开始和结束的值,

因此,这些图是用来跟踪各种活动的时间范围内(例如计划,利用各种资源,审查该项目的完成项目管理等)。这种图表类型是非常有用的,

当有必要从不同系列上面显示。

  protected override void OnLoad(EventArgs e)
{
ChartControl overlappedGanttChart = new ChartControl(); var series1 = new Series("计划", ViewType.Gantt);
var series2 = new Series("进度", ViewType.Gantt); //设置值的类型为 时间
series1.ValueScaleType = ScaleType.DateTime;
series2.ValueScaleType = ScaleType.DateTime; // 添加数据
series1.Points.Add(new SeriesPoint("市场分析", new DateTime[] {
new DateTime(, , ), new DateTime(, , ) }));
series1.Points.Add(new SeriesPoint("功能规划", new DateTime[] {
new DateTime(, , ), new DateTime(, , ) }));
series1.Points.Add(new SeriesPoint("开发规划", new DateTime[] {
new DateTime(, , ), new DateTime(, , ) }));
series1.Points.Add(new SeriesPoint("测试与Bug维护", new DateTime[] {
new DateTime(, , ), new DateTime(, , ) })); series2.Points.Add(new SeriesPoint("市场分析", new DateTime[] {
new DateTime(, , ), new DateTime(, , ) }));
series2.Points.Add(new SeriesPoint("功能规划", new DateTime[] {
new DateTime(, , ), new DateTime(, , ) }));
series2.Points.Add(new SeriesPoint("开发规划", new DateTime[] {
new DateTime(, , ), new DateTime(, , ) })); overlappedGanttChart.Series.AddRange(new Series[] { series1, series2 }); // 访问视图类型特定的选项的系列
((GanttSeriesView)series1.View).BarWidth = 0.6;
((GanttSeriesView)series2.View).BarWidth = 0.3; // 访问特定类型的选项 diagram.
GanttDiagram myDiagram = (GanttDiagram)overlappedGanttChart.Diagram;
myDiagram.AxisY.Interlaced = true;
myDiagram.AxisY.GridSpacing = ;
myDiagram.AxisY.Label.Angle = -;
myDiagram.AxisY.DateTimeOptions.Format = DateTimeFormat.MonthAndDay;
((GanttSeriesView)series1.View).LinkOptions.ArrowHeight = ;
((GanttSeriesView)series1.View).LinkOptions.ArrowWidth = ;
for (int i = ; i < series1.Points.Count; i++)
{
series1.Points[i].Relations.Add(series1.Points[i - ]);
} // 添加进度线.
ConstantLine progress =
new ConstantLine("当前的进度", new DateTime(, , ));
progress.ShowInLegend = false;
progress.Title.Alignment = ConstantLineTitleAlignment.Far;
myDiagram.AxisY.ConstantLines.Add(progress); // 调整 legend.
overlappedGanttChart.Legend.AlignmentHorizontal =
LegendAlignmentHorizontal.Right; // 添加标题
overlappedGanttChart.Titles.Add(new ChartTitle());
overlappedGanttChart.Titles[].Text = "项目计划"; overlappedGanttChart.Dock = DockStyle.Fill;
this.Controls.Add(overlappedGanttChart);
}
 //设置进度        
void SetProgressState(DateTime dateTime) {
if (dateTime > rightAxisLimit)
dateTime = rightAxisLimit;
if (CompletedSeries != null && PlannedSeries != null) {
CompletedSeries.Points.BeginUpdate();
CompletedSeries.Points.Clear();
foreach (SeriesPoint point in PlannedSeries.Points) {
DateTime plannedStartDate = point.DateTimeValues[];
if (DateTime.Compare(plannedStartDate, dateTime) >= )
continue;
DateTime plannedFinishDate = point.DateTimeValues[];
DateTime completedFinishDate;
if (DateTime.Compare(dateTime, plannedFinishDate) > )
completedFinishDate = plannedFinishDate;
else
completedFinishDate = dateTime;
CompletedSeries.Points.Add(new SeriesPoint(point.Argument, new DateTime[] { plannedStartDate, completedFinishDate }));
}
CompletedSeries.Points.EndUpdate();
}
if (HasConstantLine)
ProgressLine.AxisValue = dateTime;
}

部分代码来自于官网、在这里做个备注

Devexpress Gantt 应用的更多相关文章

  1. 项目管理工具!DevExpress Winforms Gantt控件 v19.2强势来袭

    DevExpress Winforms Controls 内置140多个UI控件和库,完美构建流畅.美观且易于使用的应用程序.无论是Office风格的界面,还是分析处理大批量的业务数据,DevExpr ...

  2. DevExpress ASP.NET v19.1版本亮点:发布全新的Gantt控件

    行业领先的.NET界面控件DevExpress 发布了v19.1版本,本文将以系列文章的方式为大家介绍DevExpress ASP.NET Controls v19.1中新增的一些控件及增强的控件功能 ...

  3. DevExpress WPF v19.1新版亮点:Gantt/Map控件新功能

    行业领先的.NET界面控件DevExpress 日前正式发布v19.1版本,本站将以连载的形式介绍各版本新增内容.在本系列文章中将为大家介绍DevExpress WPFv19.1中新增的一些控件及部分 ...

  4. DevExpress WPF v18.2新版亮点(一)

    买 DevExpress Universal Subscription  免费赠 万元汉化资源包1套! 限量15套!先到先得,送完即止!立即抢购>> 行业领先的.NET界面控件2018年第 ...

  5. Devexpress VCL Build v2014 vol 14.2.6 发布

    终于支持XE8 了.需要这么长时间吗? New Major Features in 14.2 What's New in VCL Products 14.2 Feature Highlights To ...

  6. Devexpress VCL Build v2013 vol 13.2.4 发布

    不说了,自己看吧. What's New in 13.2.4 (VCL Product Line)   New Major Features in 13.2 What's New in VCL Pro ...

  7. DevExpress VCL 已死-----关于13.1.4的发布。

    随着DevExpress VCL 13.1.4 的发布,已基本上宣布了devexpress vcl 已经死亡了. 除了一些bug 修正,没有什么新的东西,每年的订阅费又那么贵,而且delphi 现在已 ...

  8. DevExpress VCL 13.1.2 发布

    DevExpress VCL 的2013 第一个公开版发布, 基本上就是一些维护,没有大的变化,也没有FM 的支持. What's New in DevExpress VCL 13.1.2   Rel ...

  9. Devexpress VCL Build v2013 vol 13.2.3 发布

    继续修修补补,大过年的,就不吐槽了. What's New in 13.2.3 (VCL Product Line)   New Major Features in 13.2 What's New i ...

随机推荐

  1. 深入NSQ 之旅[转载]

    介绍 NSQ是一个实时的分布式消息平台.它的设计目标是为在多台计算机上运行的松散服务提供一个现代化的基础设施骨架.这篇文章介绍了 基于go语言的NSQ的内部架构,它能够为高吞吐量的网络服务器带来 性能 ...

  2. 一步步学习javascript基础篇(5):面向对象设计之对象继承(原型链继承)

    上一篇介绍了对象创建的几种基本方式,今天我们看分析下对象的继承. 一.原型链继承 1.通过设置prototype指向“父类”的实例来实现继承. function Obj1() { this.name1 ...

  3. ABP理论学习之Swagger UI集成

    返回总目录 本篇目录 介绍 安装 安装Nuget包 配置 测试 介绍 从官方网站上可以看到:"启用了Swagger API,就可以获得交互式文档,生成和发现客户端SDK". 安装 ...

  4. .NET单元测试的艺术-3.测试代码

    开篇:上一篇我们学习单元测试和核心技术:存根.模拟对象和隔离框架,它们是我们进行高质量单元测试的技术基础.本篇会集中在管理和组织单元测试的技术,以及如何确保在真实项目中进行高质量的单元测试. 系列目录 ...

  5. Python 学习文章收藏

    作者 标题 rollenholt Python修饰器的函数式编程 - Rollen Holt - 博客园 rollenholt python操作gmail - Rollen Holt - 博客园 ro ...

  6. Ubuntu 16 安装JDK1.8

    检查是否JDK已被安装: 上图表示没有安装,创建文件夹: 下载JDK: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-dow ...

  7. oc集合

    本人之前学习过一年半ios开发 由于行情太过凄惨,故转前端.心在前端,苹果亦难忘!把我平时的笔记作出给大家总结! 回顾之前的知识 便利初始化函数:框架类库中的一些类有一系列的以init开头的方法,这些 ...

  8. Delaunay Triangulation in OpenCascade

    Delaunay Triangulation in OpenCascade eryar@163.com 摘要:本文简要介绍了Delaunay三角剖分的基础理论,并使用OpenCascade的三角剖分算 ...

  9. CSS3 Media Queries实现响应式布局

    概念我就不在这里写啦.大家可以看看以下网页: http://www.runoob.com/cssref/css3-pr-mediaquery.html http://www.w3cplus.com/c ...

  10. ASP.NET MVC5 网站开发实践(二) Member区域 - 用户部分(3)修改资料、修改密码

    在上一篇博客中实现了用户的注销和登录,其实代码里落了点东西,就是用户登录要更新最后一次登录时间和登录IP,这次补上.今天做修改资料和修改密码,TryUpdateModel是新用到的东西. 目录: AS ...