Page 1 of 1

TeeChart with VS.NET problems

Posted: Fri Nov 25, 2005 7:48 am
by 9529132
I have been struggling with a simple C++ app using Teechart ActiveX in VS.NET2003. Almost all the tutorials are in VB and I just don't know how to get corresponding C++ version, even if I just want to change the Margins at runtime. Besides, it seems Teechart hasn't been fully upgraded to VS.NET environment 'cause there were always errors when I followed the tutorial 15. Any one know where I can find better manual or tutorial for C++ users,especially VC++.NET? Thanks!

Posted: Fri Nov 25, 2005 8:40 am
by narcis
Hi David Lin,

I'd suggest you to have a look at the document called "Using TeeChart Pro AX in VStudio .NET" available at TeeChart Pro ActiveX program group. At the examples folder you'll also find a VC++.NET example (C:\Program Files\Steema Software\TeeChart Pro v7 ActiveX Control\Examples\Visual Studio .NET\Vc++).

Posted: Fri Nov 25, 2005 9:14 am
by 9529132
Hi, there,
I read the code and still I couldn't find how to change margin. :( Actually, what I concern is whether there is C++ version manual of how to change the control properties and how to use the functions, not just Visual Basic help files.
Thank you!

Posted: Fri Nov 25, 2005 9:53 am
by narcis
Hi David,

I'm afraid there's not such a document. To change TChart margins using VC++ you can use:

Code: Select all

	m_ctrlChart.GetPanel().SetMarginUnits(1); //muPercent = 0, muPixels = 1
	m_ctrlChart.GetPanel().SetMarginLeft(100);
	m_ctrlChart.GetPanel().SetMarginRight(100);
	m_ctrlChart.GetPanel().SetMarginTop(50);
	m_ctrlChart.GetPanel().SetMarginBottom(50);
BTW: You'll also have to include Panel.cpp and Panel.h to your project and add #include "Panel.h" to the dialog implementation.

For TeeChart constants integer equivalent values you should have a look at C:\Program Files\Steema Software\TeeChart Pro v7 ActiveX Control\Examples\Visual C++\TeeChartDefines.h (default english installation path).

For setting properties in VC++, the names are the same as in VB, but you'll need to use the Get and Set prefixes as you can see in the snippet above and the example I mentioned before.

For more VC++ examples, even they are not for VC++.NET, you can have look at C:\Program Files\Steema Software\TeeChart Pro v7 ActiveX Control\Examples\Visual C++\Version 6 (default english installation path). The syntax will be the same for VC++.NET.

If you are still having problems please feel free to post them here.

Posted: Fri Nov 25, 2005 10:14 am
by 9529132
Hi, there,

Finally I began to have some clue of how to use it. I will try out more examples. Thanka a lot, Mr. Calvet.