Page 1 of 1
How to drag a bar vertically in Gantt Chart?
Posted: Tue May 27, 2008 2:16 am
by 9644954
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]
Posted: Tue May 27, 2008 7:26 am
by narcis
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:
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();
}
How to make the length of the bar not changed?
Posted: Tue May 27, 2008 2:27 pm
by 9644954
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.
Posted: Tue May 27, 2008 2:40 pm
by narcis
Hi kingken,
Have you tried setting DragPoint.Style to DragPointStyles.Y as I told you in my previous reply?
Thanks in advance.
another problem
Posted: Wed May 28, 2008 12:16 am
by 9644954
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 :)
Posted: Wed May 28, 2008 9:26 am
by narcis
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.
I've upload the example into your upload server
Posted: Thu May 29, 2008 1:30 am
by 9644954
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?
Posted: Thu May 29, 2008 10:49 am
by narcis
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.
How the eample emplement this function.
Posted: Fri Jun 06, 2008 6:44 am
by 9644954
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.
reply for your last answer
Posted: Fri Jun 06, 2008 6:47 am
by 9644954
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..
Posted: Fri Jun 06, 2008 7:52 am
by narcis
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.