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

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

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

  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. Metrics.NET 项目

    Metrics.NET(https://github.com/etishor/Metrics.NET)是一个给CLR 提供度量工具的包,它是移植自Java的metrics,在c#代码中嵌入Metric ...

  2. Python黑帽编程1.2 基于VS Code构建Python开发环境

    Python黑帽编程1.2  基于VS Code构建Python开发环境 0.1  本系列教程说明 本系列教程,采用的大纲母本为<Understanding Network Hacks Atta ...

  3. 剑指Offer面试题:12.在O(1)时间删除链表结点

    一.题目:在O(1)时间删除链表结点 题目:给定单向链表的头指针和一个结点指针,定义一个函数在O(1)时间删除该结点. 原文采用的是C/C++,这里采用C#,节点定义如下: public class ...

  4. Hadoop学习笔记—16.Pig框架学习

    一.关于Pig:别以为猪不能干活 1.1 Pig的简介 Pig是一个基于Hadoop的大规模数据分析平台,它提供的SQL-LIKE语言叫Pig Latin,该语言的编译器会把类SQL的数据分析请求转换 ...

  5. Web3DGame之路,Babylonjs 和TypeScript学习笔记(一)

    一个开源的Webgl3D引擎,javascript or typescript http://www.babylonjs.com 啥是WebGL WebGL 网页图形库,简称WebGL,是一个JS库, ...

  6. ASP.NET MVC 路由(一)

    ASP.NET MVC路由(一) 前言 从这一章开始,我们即将进入MVC的世界,在学习MVC的过程中在网上搜索了一下,资料还是蛮多的,只不过对于我这样的初学者来看还是有点难度,自己就想看到有一篇引导性 ...

  7. Christmas Trees, Promises和Event Emitters

    今天有同事问我下面这段代码是什么意思: var MyClass = function() { events.EventEmitter.call(this); // 这行是什么意思? }; util.i ...

  8. Script component 用法

    在SSIS中,可以使用C#编写脚本,这是十分激动人心的事,能够使用C#代码,使得Script Component无所不能. 第一部分:组件简介Script Component 有三种类型:Source ...

  9. ECMAScript6学习笔记 ——let、const、变量解构赋值

    let 不存在变量提升 通过let声明的变量仅在块级作用域内有效 不允许在同一个作用域内重复声明一个变量 防止值公用 var oUl = document.querySelectorAll('ul&g ...

  10. ExtJs4之TreePanel

    Tree介绍 树形结构,是程序开发,不可缺少的组件之一.ExtJs中的树,功能强大美观实用.功能齐全,拖拉,排序,异步加载等等. 在ExtJs4中Tree和Grid具有相同的父类,因此Grid具有的特 ...