How to customize the annotation tool programmatically (C++)?

TeeChart for ActiveX, COM and ASP
Post Reply
Frank
Newbie
Newbie
Posts: 6
Joined: Fri Sep 22, 2006 12:00 am

How to customize the annotation tool programmatically (C++)?

Post by Frank » Mon Jan 14, 2008 5:20 pm

Hi,

I'm using version 7.0.1.2 of TeeChart Pro ActiveX control. In one of my projects I'd like set the position, size, font, transparency and other parameters of the annotation tool from within my program. It is possible to customzie these parameters in the editor but how can I customize these parameters in my source code?
For the position I use

Code: Select all

m_myAnnotation.GetShape().SetLeft(someValue);
and

Code: Select all

m_myAnnotation.GetShape().SetTop(someValue);
but I didn't managed to adjust the width and height of the annotation. I'm missing member functions like

Code: Select all

m_myAnnotation.GetShape().SetWidth(), m_myAnnotation.GetShape().SetHeight()
or

Code: Select all

m_myAnnotation.GetShape().SetRight(), m_myAnnotation.GetShape().SetBottom()
. It should be possible to set these parameters because it works in the editor but how? Could you send me some example code? I'd also like to get example code for setting the font, font size, bevel, tranparency for the annotation tool.

Thanks,
Frank.

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 Jan 15, 2008 10:35 am

Hi Frank,
but I didn't managed to adjust the width and height of the annotation.
You need to use this:

Code: Select all

m_Chart1.GetTools().GetItems(0).GetAsAnnotation().SetWidth(myWidth);
	m_Chart1.GetTools().GetItems(0).GetAsAnnotation().SetHeight(myHeight);
I'd also like to get example code for setting the font, font size, bevel, tranparency for the annotation tool.
You can do it this way:

Code: Select all

	m_Chart1.GetTools().GetItems(0).GetAsAnnotation().SetText("hello world!");
	m_Chart1.GetTools().GetItems(0).GetAsAnnotation().GetShape().GetFont().SetName("Times New Roman");
	m_Chart1.GetTools().GetItems(0).GetAsAnnotation().GetShape().GetFont().SetSize(12);
	m_Chart1.GetTools().GetItems(0).GetAsAnnotation().GetShape().SetBevel(5);
	m_Chart1.GetTools().GetItems(0).GetAsAnnotation().GetShape().SetTransparency(50);
Also notice that you'll have to add the lines below to your code:

Code: Select all

#include "AnnotationTool.h"
#include "TeeShapePanel.h"
#include "TeeFont.h"
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

Frank
Newbie
Newbie
Posts: 6
Joined: Fri Sep 22, 2006 12:00 am

Post by Frank » Tue Jan 15, 2008 2:05 pm

Hi Narcis,

thanks for your help. The text/font customization works fine. But still there is no SetWidth() and SetHeight() member function for the annotation tool in version 7.0.1.2 of the TeeChart control. Despite the fact that there is no such member function it should be possible to do these adjustments somehow since it is possible to do these adjustments in the editor.

How can I do these width/height adjustments in the source code in version 7.0.1.2?

Best regards,
Frank.

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 Jan 15, 2008 2:58 pm

Hi Frank,

Those properties are available in v7.0.1.4 which is latest TeeChart Pro v7 ActiveX release. Could you please try if this version works fine at your end?

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

Frank
Newbie
Newbie
Posts: 6
Joined: Fri Sep 22, 2006 12:00 am

Post by Frank » Wed Jan 16, 2008 2:24 am

Hi Narcis,

in v7.0.1.4 it works fine. :D

Thanks again,
Frank.

Post Reply