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

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

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

  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. PostgreSQL 9.3发布

    9月9日,PostgreSQL全球开发组宣布了9.3版发布的消息.从2010年9.0版开始,PostgreSQL已经连续四个版本稳定地按时在每年9月中旬发布,从一个侧面也显示了开发团队的强大实力. 9 ...

  2. .NET面试题系列[14] - LINQ to SQL与IQueryable

    .NET面试题系列目录 名言警句 "理解IQueryable的最简单方式就是,把它看作一个查询,在执行的时候,将会生成结果序列." - Jon Skeet LINQ to Obje ...

  3. eventbus 备注

    Event在整个系统中是单例的. EventBus.getDefault().register(this); 注册 EventBus.getDefault().unregister(this); 注销 ...

  4. .NET 的 Debug 和 Release build 对执行速度的影响

    这篇文章发布于我的 github 博客:原文 在真正开始讨论之前先定义一下 Scope. 本文讨论的范围限于执行速度,内存占用什么的不在评估的范围之内. 本文不讨论算法:编译器带来的优化基本上属于底层 ...

  5. HTML5 音频播放器-Javascript代码(短小精悍)

    直接上干货咯! //HTML5 音频播放器 lzpong 2015/01/19 var wavPlayer = function () { if(window.parent.wavPlayer) re ...

  6. CSS3盒模型display:box;box-flex:3;

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name ...

  7. 【WP 8.1开发】如何动态生成Gif动画

    相信如何为gif文件编码,很多朋友都会,而难点在于怎么让GIF文件中的帧动起来,也就是创建gif动画. Gif文件编码方法 先简单介绍一下编码的方法. 1.调用BitmapEncoder.Create ...

  8. Spark中决策树源码分析

    1.Example 使用Spark MLlib中决策树分类器API,训练出一个决策树模型,使用Python开发. """ Decision Tree Classifica ...

  9. (第九天)DOM事件

    addEventListener 使用addEventListner()方法可以为事件目标注册事件处理程序.addEventListner()接受三个参数.第一个是要注册处理程序的事件类型,这个事件类 ...

  10. android帧动画,移动位置,缩放,改变透明度等动画讲解

    1.苦逼的需求又来了,需要实现一些动画效果,第一个想到的是播放gif图片,但是这样会占包的资源,并且清晰度不高,于是想着程序实现,自己用帧动画+缩放+移动+透明度 实现了一些想要的效果,这里跟大家分享 ...