X and Y Axis Labels
X and Y Axis Labels
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
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
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
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!
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 |
Instructions - How to post in this forum |
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?
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?
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");
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");
Pep Jorge
http://support.steema.com
http://support.steema.com
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
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
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Al,
Are you obtaining any error message? You may need to check what's in the include section.
Thanks in advance.
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 |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
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.
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 |
Instructions - How to post in this forum |
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
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
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.
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.
Pep Jorge
http://support.steema.com
http://support.steema.com