0

我正在尝试在 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));

有没有我可以使用的图书馆?或者如果没有,是否有任何教程可以创建它?

谢谢..

4

1 回答 1

0

你可以在 WPF 中做到这一点

http://wpfgantt.codeplex.com/

于 2012-04-26T20:18:42.473 回答