X and Y Axis Labels

TeeChart for ActiveX, COM and ASP
Post Reply
arice
Newbie
Newbie
Posts: 10
Joined: Thu Aug 09, 2007 12:00 am
Contact:

X and Y Axis Labels

Post by arice » Thu Oct 18, 2007 3:05 pm

I programing in C++ using Visual Studio 2005 using TeeChart Pro Activex v8. I need to be able to lable the X and Y axis. For instance the Y axis is showing "Savings - kWh per kW of Lighting" and the X axis is showing "Climate Zone". So, I want the label for the Y axis to run up the left side of the graph, left of the tick labels, and the label for the X axis to run along the bottom of the graph, just under the tick labels.

Since this is VC 2005 C++ and I am using your activex control I think I have to use LPDISPATCH to access anything (most irritating, by the way).

Given this how do I get the X and Y axis labels to show up?

Thanks,

Al

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Oct 18, 2007 3:11 pm

Hi Al,

Sorry but it's not clear to me what you are trying to achieve. Could you please give us some more details about you request? Is a title for each axis what are you trying to draw or a label for each data point?

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

arice
Newbie
Newbie
Posts: 10
Joined: Thu Aug 09, 2007 12:00 am
Contact:

Post by arice » Thu Oct 18, 2007 3:13 pm

A title for each axis what are you trying to draw NOT the data points.

arice
Newbie
Newbie
Posts: 10
Joined: Thu Aug 09, 2007 12:00 am
Contact:

Post by arice » Thu Oct 18, 2007 3:38 pm

I am executing the following code:

LPDISPATCH lpdAxis = m_teeChart.get_Axis();
CAxis *m_Axis = new CAxis(lpdAxis);
CAxisLabels m_AxisLabels = m_Axis->GetLabels();

m_Axis->GetLabels() in axis.cpp makes a call to:

InvokeHelper(0xb, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&pDispatch, NULL);

which returns a "Member not found." error.

So, what is the problem here?

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Mon Oct 22, 2007 1:29 pm

Hi,

in that case, if what you're trying to add is a titles for the axis, using similar code to the following should do the trick :


LPDISPATCH lpdAxis = m_teeChart.get_Axis();
CAxis *m_Axis = new CAxis(lpdAxis);

m_Axis->GetLeft()->GetTitle()->SetCaption("your axis title");
and for bottom axis :
m_Axis->GetBottom()->GetTitle()->SetCaption("your axis title");

arice
Newbie
Newbie
Posts: 10
Joined: Thu Aug 09, 2007 12:00 am
Contact:

Post by arice » Mon Oct 22, 2007 3:16 pm

Well, that brings me back to this post:

http://www.teechart.net/support/viewtop ... 6241#26241

If I create a brand new project in Visual Studio 2005 for C++, I cannot access m_Axis->GetLeft() let alone the rest of the line. If my project had been converted from a VS6 project, then I can access those functions.

I would like to request you create a new VS2005 C++ example project, add the TeeChart Pro Chart ActiveX control and then demonstrate adding the left and bottom title captions.

Thanks,

Al

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Oct 22, 2007 3:19 pm

Hi Al,

Are you obtaining any error message? You may need to check what's in the include section.

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

arice
Newbie
Newbie
Posts: 10
Joined: Thu Aug 09, 2007 12:00 am
Contact:

Post by arice » Mon Oct 22, 2007 3:31 pm

If you will read through this thread and the other thread referenced you will begin to see what my concern is.

I would like to request you create a new VS2005 C++ example project, add the TeeChart Pro Chart ActiveX control and then demonstrate adding the left and bottom title captions.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Oct 26, 2007 9:47 am

Hello arice,

I have arranged and sent you a simple example from scratch using VS2005 C++ Windows Forms and TeeChart Pro v8 ActiveX. It sets axes titles as you requested. Windows Forms applications may be the easiest way to use ActiveX controls in VS2005 and doesn't need this cumbersome syntax. If you need to use another kind of applications please let us know and we will try to arrange an example project.
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

arice
Newbie
Newbie
Posts: 10
Joined: Thu Aug 09, 2007 12:00 am
Contact:

Post by arice » Fri Oct 26, 2007 12:58 pm

Thank you for the example. I've never used WinForms before. My programming has always been in straight C++ with MFC. By the way I did finally manage to get the axis labels working by first creating a TeeChart ActiveX project in VS6 and generating the wrapper classes. Then I create my project in VS 2005 C++, copy over the wrapper classes from the VS 6 project and everything works.

The problem for me was that when adding the ActiveX control to a VS 2005 project, VS 2005 does not generate the wrapper classes for me, however doing the same in VS 6 the wrapper classes are being generated.

I don't like it, but that certainly isn't Steema's fault.

If you see something wrong in the way I create a CS 2005 C++ project, I'd sure like some input.

Thanks,

Al

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Tue Oct 30, 2007 4:59 pm

Hi Al,

ok, I glad to hear that you solved it. I'm not very familiar with VC++2005. As you said, I'm not sure why the wrapper classes are not generated automatically as VS6, maybe some steps are required to do it, which I don't know. I've also seen some posts about this on other newsgroups.

Post Reply