Windows 窗体 C# 中的甘特图
本文关键字:窗体 Windows | 更新日期: 2023-09-27 18:32:19
我正在尝试在 Windows 表单 C# 中创建甘特图,我试图找到任何库但没有运气,我找到了 MS 图表控件,但我不知道如何使用它
有来自MSDN的示例,但是当我将其放在代码上时,它没有显示任何图形
using System.Windows.Forms.DataVisualization.Charting;
...
// Populate series data
DateTime currentData = DateTime.Now.Date;
chart1.Series["Tasks"].Points.AddXY(1, currentData, currentData.AddDays(5));
chart1.Series["Tasks"].Points.AddXY(2, currentData.AddDays(5), currentData.AddDays(7));
chart1.Series["Tasks"].Points.AddXY(3, currentData.AddDays(7), currentData.AddDays(10));
chart1.Series["Tasks"].Points.AddXY(1, currentData.AddDays(10), currentData.AddDays(15));
chart1.Series["Tasks"].Points.AddXY(4, currentData.AddDays(15), currentData.AddDays(20));
chart1.Series["Tasks"].Points.AddXY(2, currentData.AddDays(20), currentData.AddDays(27));
chart1.Series["Progress"].Points.AddXY(1, currentData, currentData.AddDays(5));
chart1.Series["Progress"].Points.AddXY(2, currentData.AddDays(5), currentData.AddDays(7));
chart1.Series["Progress"].Points.AddXY(3, currentData.AddDays(7), currentData.AddDays(10));
chart1.Series["Progress"].Points.AddXY(1, currentData.AddDays(10), currentData.AddDays(13));
有没有我可以使用的库?或者如果没有,是否有任何教程来创建它?
谢谢。。
你可以在 WPF 中做到这一点
http://wpfgantt.codeplex.com/