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

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

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

  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. Sql Server数据库备份和恢复:原理篇

    本文与您探讨为什么Sql Server有完整备份.差异备份和事务日志备份三种备份方式,以及为什么数据库又有简单模式.完整模式和大容量日志模式这三种恢复模式.本文内容适用于2005以上所有版本的Sql ...

  2. 小型单文件NoSQL数据库SharpFileDB初步实现

    小型单文件NoSQL数据库SharpFileDB初步实现 我不是数据库方面的专家,不过还是想做一个小型的数据库,算是一种通过mission impossible进行学习锻炼的方式.我知道这是自不量力, ...

  3. [ASP.NET MVC 小牛之路]04 - 依赖注入(DI)和Ninject

    本人博客已转移至:http://www.exblr.com/liam  为什么需要依赖注入 在[ASP.NET MVC 小牛之路]系列的理解MVC模式文章中,我们提到MVC的一个重要特征是关注点分离( ...

  4. yar框架使用笔记

    Yar是什么 Yar是并行的RPC框架(Concurrent RPC framework),Laruence开发. 安装 下载地址:http://pecl.php.net/package/yar wi ...

  5. 浅谈android中的目录结构

    之前在android游戏开发中就遇到本地数据存储的问题:一般情形之下就将动态数据写入SD中存储,在没有SD卡的手机上就需另作处理了;再有在开发android应用的过程中,总要去调试APP,安装时又想去 ...

  6. PHP SESSION机制,从存储到读取

    PHP中,如果要获取SESSION数据,必须要有对应的session_id,session_id的获取方式有两种 1.基于客户端的cookie 2.基于url 先说第一种情况,基于客户端的cookie ...

  7. 利用typescript使backbone强类型智能提示

    模型类一旦多了没有强类型和智能提示是相当痛苦的,所以. 仅仅用ts定义一个模型类: class Person extends Backbone.Model { defaults = { Name:&q ...

  8. 一起学微软Power BI系列-官方文档-入门指南(4)Power BI的可视化

    在前面的系列文章中,我们介绍了官方有关获取数据,以及建模的原始文档和基本介绍.今天继续给大家介绍官方文档中,有关可视化的内容.实际上获获取数据和建模更注重业务关系的处理,而可视化则关注对数据的解读.这 ...

  9. lambda表达式之进化

    前言 在C#我们可以自定义委托,但是C#为什么还要内置泛型委托呢?因为我们常常要使用委托,如果系统内置了一些你可能会用到的委托,那么就省去了定义委托,然后实例化委托的步骤,这样一来既使代码看起来简洁而 ...

  10. AngularJS API之$injector ---- 依赖注入

    在AngularJS中也有依赖注入的概念,像spring中的依赖注入,但是又有所不同.Spring中使用构造注入或者设值注入的方式,还需要做一些额外的操作,但是angular中只需要在需要的地方声明一 ...