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

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

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

  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. RxJava 备注

    RxJava是一个采用观察者模式的异步框架,本文给出几个基本的使用例子. 1.配置依赖: compile 'io.reactivex:rxjava:1.0.14' compile 'io.reacti ...

  2. 现在创业做App,先做 Android 还是 iOS?

    随着互联网+的高速发展,现在创业大部分都是在布局移动端,初期往往摆在面前最大的难题是,如何分配有限的成本,在最快的速度内占领市场?这个大难题会影响创始人在团队和产品建设方方面面的决定.缩小至移动App ...

  3. Some warning were found during validation

    前几天做一个iOS下的App更新,到上传的时候出了问题,一直传了大半个小时,结果还是没传完,再试依然不行,于是只好关机,把电脑带回家弄. 回家后出现了更奇怪的事,经过漫长等待后,竟然出现这个提示: 我 ...

  4. percona5.7 源码安装

    200 ? "200px" : this.width)!important;} --> 介绍 主要为了测试percona的线程池的性能,这里就简单介绍一下percona5.7 ...

  5. Sql Server数据库备份和恢复:原理篇

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

  6. 备忘-Sql server Timeout expired 超时时间已到. 达到了最大池大小 错误及Max Pool Size设置

    select * from sysprocesses where dbid= db_id('数据库名') 通过此语句可查看目前所有的连接进程 不够了就必须设置Max Pool Size,理论最大值为3 ...

  7. 触摸java常量池

    java常量池是一个经久不衰的话题,也是面试官的最爱,题目花样百出,小菜早就对常量池有所耳闻,这次好好总结一下. 理论 小菜先拙劣的表达一下jvm虚拟内存分布:      程序计数器是jvm执行程序的 ...

  8. 我所理解的RESTful Web API [Web标准篇]

    REST不是一个标准,而是一种软件应用架构风格.基于SOAP的Web服务采用RPC架构,如果说RPC是一种面向操作的架构风格,而REST则是一种面向资源的架构风格.REST是目前业界更为推崇的构建新一 ...

  9. JavaScript面试时候的坑洼沟洄——逗号、冒号与括号

    看完了javaScript数据类型和表达式与运算符相关知识后以为可以对JavaScript笔试题牛刀小试一把了,没想到有一次次的死在逗号,冒号和括号上,不得已再看看这几个符号吧. 逗号 逗号我们常见的 ...

  10. ZooKeeper典型应用场景

    ZooKeeper典型应用场景一览 数据发布与订阅(配置中心) 发布与订阅模型,即所谓的配置中心,顾名思义就是发布者将数据发布到ZK节点上,供订阅者动态获取数据,实现配置信息的集中式管理和动态更新.例 ...