show selected bar on gantt chart
show selected bar on gantt chart
Hello, i have this gantt charts in the same forms:
like you can see, i have selected 1 bar in the upper chart, this bar changes its color to darkgreen.
in the other chart, you can see that it's 1 bar selected (the same bar as in the upper chart).
look at this picture now:
another bar is selected, but in the second chart we can't see it because there are a lot of bars over it, in the same position.
how i can do that my selected bar will be show over the other bars?
like you can see, i have selected 1 bar in the upper chart, this bar changes its color to darkgreen.
in the other chart, you can see that it's 1 bar selected (the same bar as in the upper chart).
look at this picture now:
another bar is selected, but in the second chart we can't see it because there are a lot of bars over it, in the same position.
how i can do that my selected bar will be show over the other bars?
Hi Pujol,
The gantts are shown taking in consideration their order in the series' valuelist. So, to show a gantt hided below another, you could swap the gantt for the first one. Here there is a method you could use:
The gantts are shown taking in consideration their order in the series' valuelist. So, to show a gantt hided below another, you could swap the gantt for the first one. Here there is a method you could use:
Code: Select all
private void GantToFront(int ValueIndex)
{
double tmp = gantt1.StartValues[0];
gantt1.StartValues[0] = gantt1.StartValues[ValueIndex];
gantt1.StartValues[ValueIndex] = tmp;
tmp = gantt1.EndValues[0];
gantt1.EndValues[0] = gantt1.EndValues[ValueIndex];
gantt1.EndValues[ValueIndex] = tmp;
tmp = gantt1.YValues[0];
gantt1.YValues[0] = gantt1.YValues[ValueIndex];
gantt1.YValues[ValueIndex] = tmp;
Color tmpcolor = gantt1.Colors[0];
gantt1.Colors[0] = gantt1.Colors[ValueIndex];
gantt1.Colors[ValueIndex] = tmpcolor;
string tmpstring = gantt1.Labels[0];
gantt1.Labels[0] = gantt1.Labels[ValueIndex];
gantt1.Labels[ValueIndex] = tmpstring;
tmp = gantt1.NextTasks[0];
gantt1.NextTasks[0] = gantt1.NextTasks[ValueIndex];
gantt1.NextTasks[ValueIndex] = tmp;
}
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
this code doesn't work with teechart v3 for visual basic .net
i have now this sub on my aplication:
like you can see there are some lines comented with ' simbol
this lines doesn't work because the 'EndValues' and 'NextTasks' atributes is not avaiable on VB.Net version.
how i can do this?
i have now this sub on my aplication:
Code: Select all
Private Sub gantttofront(ByVal valueindex As Integer)
Dim tmp As Double
Dim tmpcolor As Color
Dim tmpstring As String
tmp = Gantt1(0).X
Gantt1(0).X = Gantt1(valueindex).X
Gantt1(valueindex).X = tmp
' tmp = Gantt1(0).EndValues
' Gantt1(0).EndValues = Gantt1(valueindex).EndValues
' Gantt1(valueindex).EndValues = tmp
tmp = Gantt1(0).Y
Gantt1(0).Y = Gantt1(valueindex).Y
Gantt1(valueindex).Y = tmp
tmpcolor = Gantt1(0).Color
Gantt1(0).Color = Gantt1(valueindex).Color
Gantt1(valueindex).Color = tmpcolor
tmpstring = Gantt1(0).Label
Gantt1(0).Label = Gantt1(valueindex).Label
Gantt1(valueindex).Label = tmpstring
' tmp = Gantt1(0).NextTasks
' Gantt1(0).NextTasks = Gantt1(valueindex).NextTasks
' Gantt1(valueindex).NextTasks = tmp
End Sub
this lines doesn't work because the 'EndValues' and 'NextTasks' atributes is not avaiable on VB.Net version.
how i can do this?
Hi Pujol,
I'm happy to see you solved it!
I'm happy to see you solved it!
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
well, i have now a new problem, but i don't know if this is a bug or error on my code...
this is my code:
this will change the startvalues and endvalues of the bar in position 'valueindex' and 0
i'm right?
well... i click on the bar that is marked with a red circle on the upper chart, then the program will execute the code to change bar values.
befor make the click we can see it:
after i do the click the bar change its Y value!!
there's an error on my code? or it's a bug?
thanks in advance
this is my code:
Code: Select all
Private Sub gantttofront(ByVal valueindex As Integer)
Dim tmp As Double
Dim tmpcolor As Color
Dim tmpstring As String
tmp = Gantt1.StartValues(0)
Gantt1.StartValues(0) = Gantt1.StartValues(valueindex)
Gantt1.StartValues(valueindex) = tmp
tmp = Gantt1.EndValues(0)
Gantt1.EndValues(0) = Gantt1.EndValues(valueindex)
Gantt1.EndValues(valueindex) = tmp
Gantt1.Draw()
End Sub
i'm right?
well... i click on the bar that is marked with a red circle on the upper chart, then the program will execute the code to change bar values.
befor make the click we can see it:
after i do the click the bar change its Y value!!
there's an error on my code? or it's a bug?
thanks in advance
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Pujol1986,
I think this is a bug in your code. Besides changing StartValues and EndValues you should also change YValues, Labels and NextTasks as Yeray did in his example
I think this is a bug in your code. Besides changing StartValues and EndValues you should also change YValues, Labels and NextTasks as Yeray did in his example
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Hi Narcís,
My code is not like Yerays example, i have wrotte only the code that i paste in my last post.
i only change the startvalues and the endvalues of two gantt bars.
i don't change the YValues, the labels or the nexttask.
The same code has been tested on aplication with manual datasource and it works.
My aplication datasource is a Oracle DataBase.
Thanks in advance.
My code is not like Yerays example, i have wrotte only the code that i paste in my last post.
i only change the startvalues and the endvalues of two gantt bars.
i don't change the YValues, the labels or the nexttask.
The same code has been tested on aplication with manual datasource and it works.
My aplication datasource is a Oracle DataBase.
Thanks in advance.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Pujol1986,
If this doesn't help please send us a simple example project we can run "as-is" to reproduce the problem here.
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance.
I think that's the problem.i don't change the YValues, the labels or the nexttask.
It may work by some lucky coincidence. However, I think this is the problem given the images you posted.The same code has been tested on aplication with manual datasource and it works.
If this doesn't help please send us a simple example project we can run "as-is" to reproduce the problem here.
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Pujol1986,
You could create a test data table at runtime as Christopher Ireland's example here.
You should send project files but it's not necessary to send compiled files ("bin" and "obj" folders).
Thanks in advance.
You could create a test data table at runtime as Christopher Ireland's example here.
You should send project files but it's not necessary to send compiled files ("bin" and "obj" folders).
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
I have done an aplication with oracle datasource and changed the startvalues and endvalues of two lines, and it WORKS!
i can't reproduce the bug in another project.
i'll check and test my code again to find the problem (i don't think that's a bug of TeeChart)
i'll post what was the problem when i found it.
Thanks for all.
i can't reproduce the bug in another project.
i'll check and test my code again to find the problem (i don't think that's a bug of TeeChart)
i'll post what was the problem when i found it.
Thanks for all.