Page 1 of 1

Tutorial for zooming scrolling and panning

Posted: Mon Jan 05, 2004 1:11 am
by 9078641
Is it possible to get these VB examples translated to VC++

http://www.teechart.net/support/modules ... =0&thold=0

I've just spent 2 hours searching and am only able to find some bits..

// alows me to use the slider nPos value to expand from zero

m_Chart1.GetAxis().GetBottom().SetAutomatic(false);
m_Chart1.GetAxis().GetBottom().SetMinimum(0);
m_Chart1.GetAxis().GetBottom().SetMaximum(nPos);

Once expanded, I ned to use another slider to scroll across at the current zoom level.

I think this part of thr VB tutorial is what I need.
With Chart1 do
AllowPanning := pmHorizontal; //permit manual scrolling horizontally only.
BottomAxis.Automatic := False;
//limit display to 5 points onscreen
ChartScrollBar1.Chart := Chart1;
ChartScrollBar1.Kind := sbHorizontal;
ChartScrollBar1.Min := 0;
ChartScrollBar1.Max := 20;
End;

I've searched the .h files and have not found any mention of a ScrollBar class. Perhaps it's named something else.
What is ChartScrollBar1 and where are the .h amd .cpp files for it ?

I think this example makes a joke of the claim that VB examples are easiliy translated to VC++ ;

Posted: Mon Jan 05, 2004 9:03 am
by Chris
Hi --
I think this example makes a joke of the claim that VB examples are easiliy translated to VC++ ;
The example is written in Delphi :D

The Chart ScrollBar component allows scrolling of series points, setting the axis minimum and maximum values. It is a Delphi VCL component and is not available in the TeeChart Pro ActiveX Control.

In fact, the Chart ScrollBar is easy to reproduce in any of the different IDEs within MS Visual Studio ... it is simply a horizontal scroll bar with the minimum value set to 0 and the maximum to IValueList.Count and with the onscroll event firing the IAxis.Scroll method.

Scroll method Where/How

Posted: Mon Jan 05, 2004 2:08 pm
by 9078641
There are no scroll method showing up in the hints... !

m_Chart1.GetAxis().Scroll ????

Please give me an example.

VB Delphi same crap.. :D

Posted: Wed Jan 07, 2004 7:03 am
by Chris
Hi --
There are no scroll method showing up in the hints... !

m_Chart1.GetAxis().Scroll ????

Please give me an example.
Sure. Try:

Code: Select all

m_Chart1.GetAxis().GetBottom().Scroll(100, false);