Devexpress Gantt 应用
来源:互联网 发布:天刀天香捏脸数据图 编辑:程序博客网 时间:2024/05/29 18:30
甘特图属于甘特系列浏览次数(也称为时间或时间轴图表)。此视图显示横条沿时间轴。每个条形代表一个单独的事件的开始和结束的值,
因此,这些图是用来跟踪各种活动的时间范围内(例如计划,利用各种资源,审查该项目的完成项目管理等)。这种图表类型是非常有用的,
当有必要从不同系列上面显示。
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(2006, 8, 16), new DateTime(2006, 8, 23) })); series1.Points.Add(new SeriesPoint("功能规划", new DateTime[] { new DateTime(2006, 8, 23), new DateTime(2006, 8, 26) })); series1.Points.Add(new SeriesPoint("开发规划", new DateTime[] { new DateTime(2006, 8, 26), new DateTime(2006, 9, 26) })); series1.Points.Add(new SeriesPoint("测试与Bug维护", new DateTime[] { new DateTime(2006, 9, 26), new DateTime(2006, 10, 10) })); series2.Points.Add(new SeriesPoint("市场分析", new DateTime[] { new DateTime(2006, 8, 16), new DateTime(2006, 8, 23) })); series2.Points.Add(new SeriesPoint("功能规划", new DateTime[] { new DateTime(2006, 8, 23), new DateTime(2006, 8, 26) })); series2.Points.Add(new SeriesPoint("开发规划", new DateTime[] { new DateTime(2006, 8, 26), new DateTime(2006, 9, 10) })); 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 = 10; myDiagram.AxisY.Label.Angle = -30; myDiagram.AxisY.DateTimeOptions.Format = DateTimeFormat.MonthAndDay; ((GanttSeriesView)series1.View).LinkOptions.ArrowHeight = 7; ((GanttSeriesView)series1.View).LinkOptions.ArrowWidth = 11; for (int i = 1; i < series1.Points.Count; i++) { series1.Points[i].Relations.Add(series1.Points[i - 1]); } // 添加进度线. ConstantLine progress = new ConstantLine("当前的进度", new DateTime(2006, 9, 10)); 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[0].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[0]; if (DateTime.Compare(plannedStartDate, dateTime) >= 0) continue; DateTime plannedFinishDate = point.DateTimeValues[1]; DateTime completedFinishDate; if (DateTime.Compare(dateTime, plannedFinishDate) > 0) completedFinishDate = plannedFinishDate; else completedFinishDate = dateTime; CompletedSeries.Points.Add(new SeriesPoint(point.Argument, new DateTime[] { plannedStartDate, completedFinishDate })); } CompletedSeries.Points.EndUpdate(); } if (HasConstantLine) ProgressLine.AxisValue = dateTime; }
转载自http://www.cnblogs.com/w2011/p/3196206.html
0 0
- Devexpress Gantt 应用
- 对jquery-gantt的应用
- DevExpress DXTREME多渠道应用
- c# DEVexpress控件应用【winform】
- ABAP Gantt
- ILOG JViews Gantt(甘特图应用)- 交互式的资源计划和进程调度显示
- devexpress
- DevExpress
- DevExpress
- DevExpress
- DevExpress
- devexpress
- DevExpress
- devexpress
- DevExpress
- DevExpress
- [DevExpress控件应用]XtraGrid: 实现按钮列
- C# DevExpress总结-GridControl应用小结篇
- 可以实现复合控件单选的radioButton
- UVA - 1213
- 把每天做的题目存起来,虽然刚刚开始学,重在积累!加油!
- LDA主题模型简介
- 从零开始学android<ImageSwitcher图片切换组件.二十六.>
- Devexpress Gantt 应用
- 黑马程序员--一个为宝宝而努力的女程序员经历!!!!!!
- 花1K内存实现高效I/O的RandomAccessFile类
- facebook comments plugins 介绍
- C/C++ 定义并赋值二维数组
- 删除公司时,若公司下面有部门、角色、用户,则不允许删除,并显示提示信息
- MFC任务栏操作
- 购买恩智浦的NFC标签NFC支付系统由中国RFID
- 透过 Linux 内核看无锁编程