Page 1 of 1

Double axis & horizontal "zoom"

Posted: Thu Aug 18, 2005 7:50 am
by 9637812
Hi,

I'm using Teechart.NET v2 (but started with the v1 trial) for Gantt charting. I'm now trying to have two horizontal axis with different scales:

labels...............18-08......................................................19-08
the first one ------|-------------------------------------------------|-----------

labels...............00:00........................12:00......................00:00
the second one ---|-------------------------|-----------------------|-----------

and then having them two sinchronized with an horizontal only zoom (I mean: when I zoom the x axis are the only one affected without changing the y one).

Any suggestion? Thanks in advance

Regards

Posted: Thu Aug 18, 2005 8:28 am
by narcis
Hi Cinin,

You can set zoom only being horizontal or vertical for your chart. This can be done using the chart editor at Chart -> General tab or at run-time using:

Code: Select all

tChart1.Zoom.Direction = Steema.TeeChart.ZoomDirections.Horizontal;

Posted: Thu Aug 18, 2005 9:36 am
by 9637812
Thanks Narcis,

I set the chart to display the bars starting at the top of it instead of centered. Now I have a trackbar with 3 possibile position and I do when it's changed:

Code: Select all

			if (YOU_WANT_TO_ZOOM_OUT) 
			{
				double tmp = tChart1.Axes.Left.MinXValue;
				Rectangle r = new Rectangle(210,97,78,90); 
				tChart1.Zoom.ZoomRect(r); 
				zoomBar.Tag = zoomBar.Value;				
				tChart1.Axes.Left.AdjustMaxMin();
			}
			else // YOU_WANT_TO_ZOOM_IN
			{
				tChart1.Zoom.ZoomPercent(1.0);
			}
but the the bars are centered again (and I imagine the code above isn't the best to do a zoom).

BTW: what about the double axis issue? I tried with custom axis and other thing but I'm unable to have different scale (and different labels) keeping them sinchronized.

Thanks again

Posted: Thu Aug 18, 2005 11:26 am
by narcis
Hi Cinin,

Could you please send us an example we can run "as-is" to reproduce the problem here? You can post your files at [url]news://www.steema.net/steema.public.attachments[/url] newsgroup.
BTW: what about the double axis issue? I tried with custom axis and other thing but I'm unable to have different scale (and different labels) keeping them sinchronized.
I thought your problem was how to zoom horizontally only. Could you please specify which is your exact problem and post an example if possible as well?

Thanks in advance.

Posted: Thu Aug 18, 2005 12:50 pm
by 9637812
thank you again Narcis, I'll try to build a running example stripping away all the others things.

BTW: in a gantt chart how can I change the start, end and/or value of a task?

I click on a task, retreive some info in the clickSeries event but I'm unable to find where I can change the values of that task. I found the X & Y properties but i need to change both the start and the width of the task!

Thanks in advance

Posted: Thu Aug 18, 2005 12:55 pm
by 9637812
I found the gantt drag tool, pheraps I can take something from it :-)