|
Hallo
great Project - very nice
How can i add more Rows?
I trying this for testing.....
Dim lst As New List(Of BarInformation)
lst.Add(New BarInformation("Row 1", New Date(2011, 7, 3), New Date(2011, 7, 5), Color.Aqua, Color.Khaki, 0))
lst.Add(New BarInformation("Row 2", New Date(2011, 7, 1), New Date(2011, 7, 2), Color.AliceBlue, Color.Khaki, 1))
lst.Add(New BarInformation("Row 3", New Date(2011, 7, 5), New Date(2011, 7, 7), Color.Violet, Color.Khaki, 2))
lst.Add(New BarInformation("Row 4", New Date(2011, 7, 3), New Date(2011, 7, 5), Color.Aqua, Color.Khaki, 3))
lst.Add(New BarInformation("Row 5", New Date(2011, 7, 6), New Date(2011, 7, 5), Color.Aqua, Color.Khaki, 3))
but the row 5 overwrite row 4.
Can you help me?
|
|
|
|
|
Try to change the row index number for the last row. Both row 4 and 5 is set to use row index 3
Color.Aqua, Color.Khaki, 3))
The bolded part is the row index. Change that number to 4 and it will add a new row. The first row has index 0, second row has index 1, etc
Hope that helped
|
|
|
|
|
ohhh sh*t
i see a lot of tree .... but can't see the forest
Thanks it works
|
|
|
|
|
|
How Can add another text column HELP
|
|
|
|
|
|
I found the code that caused the ghost bars and I fixed it for you:
If bar.StartValue < FromDate Then
lengthTimeSpan = endValue - FromDate
Else
lengthTimeSpan = endValue - bar.StartValue
End If
Now bars won't draw when they don't need to be drawn.
|
|
|
|
|
Hello,
First of all I wanted to thank you for your amazing control, it has been a real life-saver for me!
I have been trying to make the chart bar a bit "dynamic", I can increase / decrease the days, go to month view, etc...
But I have encountered a small glitch, when I navigate to the next day there is a bar that shouldn't be there (also nothing happens when I hover over it)
This my example: I added an event on the 25th of december, from 10 to 12.
public Chart()
{
InitializeComponent();
ganttChart1.FromDate = new DateTime(2012, 12, 24, 08, 0, 0);
ganttChart1.ToDate = new DateTime(2012, 12, 24, 18, 0, 0);
DateTime test = new DateTime(2012, 12, 25, 10, 00, 00);
DateTime test2 = new DateTime(2012, 12, 25, 12, 00, 00);
ganttChart1.AddChartBar("Row 1", null, test, test2, Color.Aqua, Color.Khaki, 0);}
ganttChart1.AddChartBar("Row 2", null, test, test2, Color.Red, Color.DarkRed, 1);
This appears correctly like this: [^]
Now I used this code to navigate to the next day:
private void button1_Click(object sender, EventArgs e)
{
DateTime newFrom = ganttChart1.FromDate.AddDays(1);
DateTime newTo = ganttChart1.ToDate.AddDays(1);
ganttChart1.FromDate = newFrom;
ganttChart1.ToDate = newTo;
ganttChart1.PaintChart();
ganttChart1.Refresh();
}
But when I click that button, a strange chart bar appears from the beginning of the Gantt Chart (no matter what the start hour is), it's also the exact same length as the normal event on the previous day. http://localhostr.com/file/f2HdDA2/gantt_2.png[^]
I have no idea what's causing this. This "Ghost" chart bar doesn't appear when I go back in the days or when I go to month view.
private void button2_Click(object sender, EventArgs e)
{
DateTime newFrom = ganttChart1.FromDate.AddDays(-1);
DateTime newTo = ganttChart1.ToDate.AddDays(-1);
ganttChart1.FromDate = newFrom;
ganttChart1.ToDate = newTo;
ganttChart1.PaintChart();
ganttChart1.Refresh();
}
private void btnMaand_Click(object sender, EventArgs e)
{
DateTime newFrom = new DateTime(ganttChart1.FromDate.Year, ganttChart1.FromDate.Month,1);
DateTime newTo = new DateTime(ganttChart1.ToDate.Year, ganttChart1.ToDate.Month, 31);
ganttChart1.FromDate = newFrom;
ganttChart1.ToDate = newTo;
ganttChart1.PaintChart();
ganttChart1.Refresh();
}
I'm sorry to bother you with this problem, but I can't figure it out.
Thanks,
Thomas
|
|
|
|
|
Do you have c# version??I want to study it.Thanks!
|
|
|
|
|
You could simply open the sample project, change the project settings to "library" instead of "executeable", possibly change its name and namespace there also to "Gantt" (and if you want to, remove the Form1.vb from the project).
Compile it (preferably as Release, not Debug).
Pick your new "Gantt.dll" (or "Testproject.dll" if you left the project name) from the bin/Release Subfolder of the project, and copy it to your C# project folder (or even better under a subfolder there, like "libs").
In your C# project you can now simply right-click on "References", "Add reference", and "Browse" to the dll to add it.
Now you have the Gantt (namespace) available (possibly again with "using Testproject;" instead of Gantt if you didn't change that), and if you want to further add it to your designer, you could even do that by right-clicking at your custom project components header in the "Toolbox", click on "Select elements", browse again to your dll and add it, voila.
Works very well for me
|
|
|
|
|
|
Not working very well. The tool tips are buggy but good work anyway.
modified 31-Dec-11 1:35am.
|
|
|
|
|
thanks maan if only you knew how manny lives you have saved you are a hero
|
|
|
|
|
Exactly what I was about to write. Massive timesave and excellent tool.
|
|
|
|
|
i need some help i need to add a text box for adding date ranges near row number column
can u help me with that i really need this help
|
|
|
|
|
hj Adagio
I want to use this chart in C# form for studying
Could you help me convert this code?
Thanks so much!^^
|
|
|
|
|
I don't have a C# version of this code available, can't help you there, sorry
But you can try to get some help from the vb.net to C# converters that are available. They aren't going to make it perfect, but might help you convert it
|
|
|
|
|
|
rongconmocrang wrote: I want to use this chart in C# form for studying
Could you help me convert this code? Hi, Check this blog post .NET Code Conversion[^]
|
|
|
|
|
I learn VB.Net and GDI+ just to make ganttchart and s curve in my application, and you open my view widely by this code and nice control. Thank you. May God bless you for success life.
|
|
|
|
|
Thanks, glad you like it
I'm not good at GDI+ either, but I did learn a lot from doing this project
|
|
|
|
|
Exactly what I needed!
Managed to modify it a bit, adding a type to the barinformation which now displays in the tooltip.
And changed the line with comment ' The minimum interval of time between the headers ' to use 15 minutes so it has a more logical time scale in day view.
Sorry to hear you lost interest in further development, the control certainly fills a gap.
If anyone adopts this project and builds the horizontal ruler that would be great!
|
|
|
|
|
Glad you could use it and modify it to fit your needs
While I haven't lost interest in the project, there just isn't enough time to continue work on this project. I would love to do some more work on it, but I have tons of other higher priority projects at the moment
|
|
|
|
|
Dear Adagoi
This is very nice and Usefull Control u made...
There were Lots of Limitation in Crystal Report for Gantt Chart
bt you made is easy and Proper..
Great job....
Thanks Again...
Wish you Success ahead
Sandip Mevada
|
|
|
|
|
Glad you like it
I also spent a lot of time trying to find a good gantt chart control that was easy to use, but wasn't really able to find one that fitted to my needs, but at least now there's a decent one around for free for everybody to use
|
|
|
|
|