|
Hi Adagio.81,
Have you update your control with Horizzontal scrollbar?
Thanks.
|
|
|
|
|
Hi Adagio.81,
How can we add Horizontal Scroll Bar to Gantt Chart.
Thanks.
|
|
|
|
|
As you said EASY to use, no pain to get running. Solves simple problems without all added complexities of other controls.
|
|
|
|
|
I have been playing with this for a while. I think this is great (Some limitations, but with everyones help it could be a good tool. So here is my change. I hope you like it.
Change (In DrawBars)
grfx.FillRectangle(obBrush, obRect)
grfx.DrawRectangle(Pens.Black, obRect)
To
Dim Radius As Integer = d / 2
Dim gp As GraphicsPath = New GraphicsPath()
If c <= 0 Then
Else
If c < Radius * 2 Then
If c < Radius Then
gp.AddLine(a, b, (a + c), b)
gp.AddLine(a + c, b, a + c, (b + d))
gp.AddLine((a + c), b + d, a, b + d)
gp.AddLine(a, (b + d), a, b)
gp.CloseFigure()
Else
gp.AddLine(a, b, (a + c) - Radius, b)
gp.AddArc((a + c) - Radius, b, Radius, Radius, 270, 90)
gp.AddLine(a + c, b + Radius, a + c, (b + d) - Radius)
gp.AddArc((a + c) - Radius, (b + d) - Radius, Radius, Radius, 0, 90)
gp.AddLine((a + c) - Radius, b + d, a, b + d)
gp.AddLine(a, (b + d) - Radius, a, b)
gp.CloseFigure()
End If
Else
gp.AddLine(a + Radius, b, (a + c) - Radius, b)
gp.AddArc((a + c) - Radius, b, Radius, Radius, 270, 90)
gp.AddLine(a + c, b + Radius, a + c, (b + d) - Radius)
gp.AddArc((a + c) - Radius, (b + d) - Radius, Radius, Radius, 0, 90)
gp.AddLine((a + c) - Radius, b + d, a + Radius, b + d)
gp.AddArc(a, (b + d) - Radius, Radius, Radius, 90, 90)
gp.AddLine(a, (b + d) - Radius, a, b + Radius)
gp.AddArc(a, b, Radius, Radius, 180, 90)
gp.CloseFigure()
End If
End If
grfx.SmoothingMode = SmoothingMode.AntiAlias
grfx.FillPath(obBrush, gp)
grfx.DrawPath(obPen, gp)
|
|
|
|
|
Hi,
I've downloaded the source code and tried to compile it. But gives error that control is missing. Do you have any DLL files separately to run the code?
Thanks,
Arun
|
|
|
|
|
Hi ...It's exactly the control um looking for, but is there any chance that you developed a web version of it??
|
|
|
|
|
I need version in web application to C#.
My application make control of position aicraft in box of aiport.
I need very help.
tanks
|
|
|
|
|
|
GanttChart.cs Line 56, it does not seem to work because I can't see the ToolTip.
So I modify,
this.GanttChart1.ToolTip.Draw += new DrawToolTipEventHandler(this.GanttChart1.ToolTipText_Draw);
this.GanttChart1.ToolTip.Popup += new PopupEventHandler(this.GanttChart1.ToolTipText_Popup);
on Form1_Load.
|
|
|
|
|
in My project, I have list item. for each item have gantt chart.
when user click on item, system will load grantt chart'item.
I meet problem when user click other item the your lib need to deplay time for refesh and draw chart again.
How to add waitting cursors when your lib draw chart ( I had add cursors in my code but it not effect).
|
|
|
|
|
Here is a very simple example how to add text to the center of each bar. You can adjust to fit your application, create a new sub to populate from your data source or add a new property 'bar.text' etc.
After the code in GanttChart.vb
grfx.DrawRectangle(Pens.Black, obRect)
grfx.FillRectangle(obBrush, obRect)
Add this:
Dim txt As String = "raz" & ControlChars.CrLf & "dwa" & ControlChars.CrLf & "trzy"
Dim txtFont As New Font("Arial", 10)
Dim txtWidth As Integer = grfx.MeasureString(txt, txtFont).Width
Dim txtHeight As Integer = grfx.MeasureString(txt, txtFont).Height
Dim barWidth As Integer = bar.TopLocation.Right.X - bar.TopLocation.Left.X
If txtWidth < barWidth And txtHeight < barHeight Then
grfx.DrawString(txt, txtFont, Brushes.Black, (barWidth / 2 - txtWidth / 2) + bar.TopLocation.Left.X, (barHeight / 2 - txtHeight / 2) + bar.TopLocation.Left.Y)
End If
This will only work if the text will fit inside the bar. My bars are 108 pixels tall so i can fit several lines but if yours are small or the default size, try one line
|
|
|
|
|
In the example chart 1 contians days while the upper only month, how to control it???
|
|
|
|
|
Currently it is only controlled automatically based on the time between first date and last date. You might want to look at the function
GetFullHeaderList
|
|
|
|
|
Kanon Adrian
Fandt din kode ved et tilf�lde - lige hvad jeg manglede
/Morten
|
|
|
|
|
Er glad for at du kan bruge det
|
|
|
|
|
Why two almost identical for loops ?
The bar is not yet needed!!!
The foreach Loop is needless
The Speed will increase dramatically
Optimised version:
Private Sub DrawNetHorizontal(ByVal grfx As Graphics)
Dim FUN As String = "DrawNetHorizontal"
Dim index As Integer = 0
Dim width As Integer = 0
Try
If shownHeaderList Is Nothing Then Exit Sub
If shownHeaderList.Count = 0 Then Exit Sub
index = 0
width = (widthPerItem * shownHeaderList.Count) + barStartLeft
For index = 0 To GetIndexChartBar("QQQQQQ")
Try
grfx.DrawLine(lineColor, 0, barStartTop + (barHeight * index) + (barSpace * index), width, barStartTop + (barHeight * index) + (barSpace * index))
Catch EXC As Exception
End Try
Next
lastLineBottomStop = barStartTop + (barHeight * (index - 1)) + (barSpace * (index - 1))
Catch EXC As Exception
End Try
End Sub
Greetings
vmeyer
|
|
|
|
|
Hi, is there a way to show text on bars permanently?
|
|
|
|
|
yes, on draw bar area find
Grfx.DrawRectangle(Pens.Black, obRect)
and add this below it
Grfx.DrawString("YourText", rowtextfont, Brushes.LimeGreen, obRect)
|
|
|
|
|
Hello,
got it running now, found the dll.
how can i achieve a larger vertical spacing for the bars or even broaden them ?
Greetings
mjfuchs
|
|
|
|
|
Hi,
try to change the code line:
Private barHeight As Integer = 9
in GanttChart Class. If you increase the value the bars get heigher.
If you need more space between the bars lines change the code line:
Private barSpace As Integer = 5
Have a nice day.
modified 4-Nov-12 8:46am.
|
|
|
|
|
Hello,
i found this an liked it very much. I am using VB 2010 Express and whenn starting the sample it works. but i do get the following message:
Warnung 1 Der Typ "TestApplication.GanttChart" wurde nicht gefunden. Stellen Sie sicher, dass auf die Assembly, die diesen Typ enthält, verwiesen wird. Wenn dieser Typ Teil Ihres Entwicklungsprojekts ist, stellen Sie sicher, dass das Projekt mithilfe der Einstellungen für die aktuelle Plattform oder eine beliebige CPU erstellt wurde. 0 0
My Questions:
How do i get rid off that message because i want to write a deliverable application ?
Where do i find the control object to integrate it in my own applications/forms ?
Are there any references /DLL or anything to load to get the control ?
Greetings Matthias
|
|
|
|
|
Hello,
how to make signatures on blocks?
Sorry, My English is bad!
|
|
|
|
|
Hi there,
Firstly big thanks to Adagio.81 for your contribution and time in making this control!
I've converted the GanttChart to C#, but I'm having difficulty with it if anyone can help on these 2 issues (class added below)?
1) Initially it was causing VS to crash so I've temporarily excluded the paint method from firing when in design mode
2) It's loading all bars with 1 pixel width irrespective of the values you put in?
Sample Bars:
ganttChart1.FromDate = new System.DateTime(2009, 1, 1, 0, 0, 0);
ganttChart1.ToDate = new System.DateTime(2009, 12, 31, 0, 0, 0);
List lst = new List();
lst.Add(new BarInformation("Row 1", new System.DateTime(2009, 1, 1), new System.DateTime(2009, 5, 1), Color.Gray, Color.LightGray, 0));
lst.Add(new BarInformation("Row 2", new System.DateTime(2009, 1, 1), new System.DateTime(2009, 7, 1), Color.Gray, Color.LightGray, 1));
lst.Add(new BarInformation("Row 3", new System.DateTime(2009, 5, 1), new System.DateTime(2009, 8, 1), Color.Gray, Color.LightGray, 2));
lst.Add(new BarInformation("Row 2", new System.DateTime(2009, 10, 1), new System.DateTime(2009, 12, 1), Color.Gray, Color.LightGray, 3));
lst.Add(new BarInformation("Row 1", new System.DateTime(2009, 8, 1), new System.DateTime(2009, 11, 1), Color.Gray, Color.LightGray, 4));
foreach (BarInformation bar in lst)
{
ganttChart1.AddChartBar(bar.RowText, bar, bar.FromTime, bar.ToTime, bar.Color, bar.HoverColor, bar.Index);
}
Class:
http://pastebin.com/RdttF899
Kind Regards
Chris
___________________________
"There are 10 types of people in the world.
Those that understand binary... and those that don't!"
|
|
|
|
|
Hi again,
I've posted new changes to the C# version of the Gantt Chart - http://pastebin.com/b6HsgvXN[^]
It's now displaying the bars and layout correctly. I'm currently working on (adding) a "BarChanging" event for the control.
Will keep you posted.
Kind Regards
Chris
___________________________
"There are 10 types of people in the world.
Those that understand binary... and those that don't!"
|
|
|
|
|
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?
|
|
|
|
|