How to drag a bar vertically in Gantt Chart?

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
kingken
Newbie
Newbie
Posts: 9
Joined: Mon Apr 30, 2007 12:00 am

How to drag a bar vertically in Gantt Chart?

Post by kingken » Tue May 27, 2008 2:16 am

Now we met a problem when we were using the tool dragpoint to implement the vertical dragging function in Gantt chart:
If we drag a bar from one vertical axes to another one, the bar will automaticlly change its length. Is there any way to keep the bar's length not to be changed when dragging it.
Another thing is: is there any way to drag the bar directly into the vertical axes we defined by ourseleves not move little by little. For example, we defined 3 vertical axes, their value are: 1,2,3. Now I want to drag a bar from 1 to 3 directly, do you have any better way to implement this function.
[img]http://yfq003.blog.163.com/editPhoto.do ... 7084095065
[/img]

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue May 27, 2008 7:26 am

Hi kingken,

Yes, you can set DragPoint tool to just drag points vertically:

Code: Select all

			dragPoint1.Style = Steema.TeeChart.Tools.DragPointStyles.Y;
For changing the Y value of a gantt bar you can do this:

Code: Select all

			gantt1.YValues[0] = 5;
Or using ClickSeries event, for example:

Code: Select all

		void tChart1_ClickSeries(object sender, Steema.TeeChart.Styles.Series s, int valueIndex, MouseEventArgs e)
		{
			s.YValues[valueIndex] = 5;
			s.Repaint();
		}
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

kingken
Newbie
Newbie
Posts: 9
Joined: Mon Apr 30, 2007 12:00 am

How to make the length of the bar not changed?

Post by kingken » Tue May 27, 2008 2:27 pm

Thanks for your help.

But how to keep the length of the bar not be changed when it was dragged vertically. Because we found this problem, when we drag it from one Y axes to another one it will automatically change its length. You can find the pic in the URL I sent in the first post.

Please help us solve this problem as soon as possible, thank you.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue May 27, 2008 2:40 pm

Hi kingken,

Have you tried setting DragPoint.Style to DragPointStyles.Y as I told you in my previous reply?

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
Image Image Image Image Image Image
Instructions - How to post in this forum

kingken
Newbie
Newbie
Posts: 9
Joined: Mon Apr 30, 2007 12:00 am

another problem

Post by kingken » Wed May 28, 2008 12:16 am

Hello thanks for your help, I've solved these two problems :)

But I met another problem, when I drag the bar from one y axes to another one, the bar's y axes will also moved with the bar together.

for example, bar a is in y axes-->1, now I want to drag it into y axes-->2, when I drag it, y axes-->1 will split into two y axes-->1, one of them will move together with the bar.

I do not want to move the bar together with the y axes, do you have any better way to solve this problem, thank you :)

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed May 28, 2008 9:26 am

Hi kingken,

Could you 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
Image Image Image Image Image Image
Instructions - How to post in this forum

kingken
Newbie
Newbie
Posts: 9
Joined: Mon Apr 30, 2007 12:00 am

I've upload the example into your upload server

Post by kingken » Thu May 29, 2008 1:30 am

Inside is the example, when you try to drag the bar vertically, the y axes of the bar will move together with it, but we just want to move the bar only, is there any way to solve this problem?

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu May 29, 2008 10:49 am

Hi kingken,

Thanks for the example project. I'm not 100% sure about what do you mean. However, if you don't want left axis grid lines move when gantt bars are being dragged, the only solution I can think of is hidding them:

Code: Select all

						this.ganttSeries1.GetVertAxis.Grid.Visible = false;
If this doesn't help please let us know.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

kingken
Newbie
Newbie
Posts: 9
Joined: Mon Apr 30, 2007 12:00 am

How the eample emplement this function.

Post by kingken » Fri Jun 06, 2008 6:44 am

I found in the example, when we drag a dragpoint, it will move freely with no y axes moving.

So it should also work for gantt bar, please help us solve this problem. Thank you.

kingken
Newbie
Newbie
Posts: 9
Joined: Mon Apr 30, 2007 12:00 am

reply for your last answer

Post by kingken » Fri Jun 06, 2008 6:47 am

If we hide the y axex, then we can not see all y axeses, that's not acceptable. We just want to hide the y axes of the bar when we moved it.
Please try to solve this problem, it's really urgent, thank you..

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Jun 06, 2008 7:52 am

Hi kingken,
I found in the example, when we drag a dragpoint, it will move freely with no y axes moving.
I'm not 100% sure about what you mean here. However, y axis scale will only be modified if you drag the points outside the bounds of current axis scale. If this doesn't help please give us some more details about the exact problem.
If we hide the y axex, then we can not see all y axeses, that's not acceptable. We just want to hide the y axes of the bar when we moved it.
Yes, it's only possible to hide the grid for the entire axis, it's not possible to hide one bar's gride line.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply