Writing code to Plot Points
-
- Newbie
- Posts: 35
- Joined: Wed Dec 12, 2007 12:00 am
What I asked for was a VS2005 project that compiles. This project doesn't compile. There was no C++ code that really did anything. I asked for a sample VS2005 project which uses C++ code to plot a 2-D line plot. I want this to be done in C++ code. Is this too much to ask? How long will it take before I get code that works?
Here are the compiler errors:
Deleting intermediate and output files for project 'VC++WinForms', configuration 'Release|Win32'
Copying 'g:\temp\VC++WinForms\VC++WinForms\Interop\AxInterop.TeeChart.1.0.dll' to target directory...
Compiling...
stdafx.cpp
Compiling...
VC++WinForms.cpp
g:\temp\vc++winforms\vc++winforms\Form1.h(89) : error C2039: 'FillSampleValues' : is not a member of 'TeeChart::ISeries'
g:\temp\vc++winforms\vc++winforms\Form1.h(91) : error C2039: 'Left' : is not a member of 'TeeChart::IAxes'
g:\temp\vc++winforms\vc++winforms\Form1.h(91) : error C2227: left of '->Title' must point to class/struct/union/generic type
g:\temp\vc++winforms\vc++winforms\Form1.h(91) : error C2227: left of '->Visible' must point to class/struct/union/generic type
g:\temp\vc++winforms\vc++winforms\Form1.h(92) : error C2039: 'Left' : is not a member of 'TeeChart::IAxes'
g:\temp\vc++winforms\vc++winforms\Form1.h(92) : error C2227: left of '->Title' must point to class/struct/union/generic type
g:\temp\vc++winforms\vc++winforms\Form1.h(92) : error C2227: left of '->Caption' must point to class/struct/union/generic type
g:\temp\vc++winforms\vc++winforms\Form1.h(93) : error C2039: 'Bottom' : is not a member of 'TeeChart::IAxes'
g:\temp\vc++winforms\vc++winforms\Form1.h(93) : error C2227: left of '->Title' must point to class/struct/union/generic type
g:\temp\vc++winforms\vc++winforms\Form1.h(93) : error C2227: left of '->Visible' must point to class/struct/union/generic type
g:\temp\vc++winforms\vc++winforms\Form1.h(94) : error C2039: 'Bottom' : is not a member of 'TeeChart::IAxes'
g:\temp\vc++winforms\vc++winforms\Form1.h(94) : error C2227: left of '->Title' must point to class/struct/union/generic type
g:\temp\vc++winforms\vc++winforms\Form1.h(94) : error C2227: left of '->Caption' must point to class/struct/union/generic type
AssemblyInfo.cpp
Build log was saved at "file://g:\temp\VC++WinForms\VC++WinForms\Release\BuildLog.htm"
VC++WinForms - 13 error(s), 0 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
Here are the compiler errors:
Deleting intermediate and output files for project 'VC++WinForms', configuration 'Release|Win32'
Copying 'g:\temp\VC++WinForms\VC++WinForms\Interop\AxInterop.TeeChart.1.0.dll' to target directory...
Compiling...
stdafx.cpp
Compiling...
VC++WinForms.cpp
g:\temp\vc++winforms\vc++winforms\Form1.h(89) : error C2039: 'FillSampleValues' : is not a member of 'TeeChart::ISeries'
g:\temp\vc++winforms\vc++winforms\Form1.h(91) : error C2039: 'Left' : is not a member of 'TeeChart::IAxes'
g:\temp\vc++winforms\vc++winforms\Form1.h(91) : error C2227: left of '->Title' must point to class/struct/union/generic type
g:\temp\vc++winforms\vc++winforms\Form1.h(91) : error C2227: left of '->Visible' must point to class/struct/union/generic type
g:\temp\vc++winforms\vc++winforms\Form1.h(92) : error C2039: 'Left' : is not a member of 'TeeChart::IAxes'
g:\temp\vc++winforms\vc++winforms\Form1.h(92) : error C2227: left of '->Title' must point to class/struct/union/generic type
g:\temp\vc++winforms\vc++winforms\Form1.h(92) : error C2227: left of '->Caption' must point to class/struct/union/generic type
g:\temp\vc++winforms\vc++winforms\Form1.h(93) : error C2039: 'Bottom' : is not a member of 'TeeChart::IAxes'
g:\temp\vc++winforms\vc++winforms\Form1.h(93) : error C2227: left of '->Title' must point to class/struct/union/generic type
g:\temp\vc++winforms\vc++winforms\Form1.h(93) : error C2227: left of '->Visible' must point to class/struct/union/generic type
g:\temp\vc++winforms\vc++winforms\Form1.h(94) : error C2039: 'Bottom' : is not a member of 'TeeChart::IAxes'
g:\temp\vc++winforms\vc++winforms\Form1.h(94) : error C2227: left of '->Title' must point to class/struct/union/generic type
g:\temp\vc++winforms\vc++winforms\Form1.h(94) : error C2227: left of '->Caption' must point to class/struct/union/generic type
AssemblyInfo.cpp
Build log was saved at "file://g:\temp\VC++WinForms\VC++WinForms\Release\BuildLog.htm"
VC++WinForms - 13 error(s), 0 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
-
- Newbie
- Posts: 35
- Joined: Wed Dec 12, 2007 12:00 am
I would like to know if you even looked at the code I uploaded yesterday. It is a very simple example. I just wanted it to compile and plot a point. I created a TChart Active X Control and placed it on a dialog. What I want to do is to plot a 2-D line plot, by using points defined at runtime. Is that too difficult for you to do?
Hi,
the errors you're getting are related with the TeeChart headers. Adding a TeeChart component into a VC++2005 project does not add all the required header files automatically into the project ( as VC6 does ) , this step must be done manually.
To solve your problem you'd have to copy all the TeeChart header files (included into the TeeChart Pro installation) to your project folder or another specific folder and add them to your project.
Then you will be able to use similar code to the following:
the errors you're getting are related with the TeeChart headers. Adding a TeeChart component into a VC++2005 project does not add all the required header files automatically into the project ( as VC6 does ) , this step must be done manually.
To solve your problem you'd have to copy all the TeeChart header files (included into the TeeChart Pro installation) to your project folder or another specific folder and add them to your project.
Then you will be able to use similar code to the following:
Code: Select all
m_Chart1.AddSeries(scBar);
CSeries bar1 = m_Chart1.Series(0);
bar1.FillSampleValues(20);
Pep Jorge
http://support.steema.com
http://support.steema.com
-
- Newbie
- Posts: 35
- Joined: Wed Dec 12, 2007 12:00 am
Hi,
I think the sample project which we sent to you was created with vc6 and converted to vc2005 automatically opening it with vc2005.
I think the sample project which we sent to you was created with vc6 and converted to vc2005 automatically opening it with vc2005.
Pep Jorge
http://support.steema.com
http://support.steema.com
-
- Newbie
- Posts: 35
- Joined: Wed Dec 12, 2007 12:00 am
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi marathoner,
You can set chart to 2D using this:
For setting axes minimum and maximum values use this:
You can set chart to 2D using this:
Code: Select all
m_Chart1.GetAspect().SetView3D(false);
Code: Select all
m_Chart1.GetAxis().GetBottom().SetMinMax(0,100);
m_Chart1.GetAxis().GetLeft().SetMinMax(0,100);
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 |
-
- Newbie
- Posts: 35
- Joined: Wed Dec 12, 2007 12:00 am
This is the declaration for get_bottom. This is in CAxes.h
LPDISPATCH get_Bottom()
{
LPDISPATCH result;
InvokeHelper(0x4, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&result, NULL);
return result;
}
This is the declaration for SetMinMax. This is declared in CAxis.h
void SetMinMax(double AMin, double AMax)
{
static BYTE parms[] = VTS_R8 VTS_R8 ;
InvokeHelper(0x35, DISPATCH_METHOD, VT_EMPTY, NULL, parms, AMin, AMax);
}
The code you sent to me is incorrect.
LPDISPATCH get_Bottom()
{
LPDISPATCH result;
InvokeHelper(0x4, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&result, NULL);
return result;
}
This is the declaration for SetMinMax. This is declared in CAxis.h
void SetMinMax(double AMin, double AMax)
{
static BYTE parms[] = VTS_R8 VTS_R8 ;
InvokeHelper(0x35, DISPATCH_METHOD, VT_EMPTY, NULL, parms, AMin, AMax);
}
The code you sent to me is incorrect.
-
- Newbie
- Posts: 35
- Joined: Wed Dec 12, 2007 12:00 am
This is the code that compiles and executes properly to plot a series of points. If I used your code, it would never have compiled.
pulsecht1.ClearChart();
CAspect temp1 = pulsecht1.get_Aspect();
temp1.put_View3D(FALSE);
long series1 = pulsecht1.AddSeries(scLine);
CSeries temp = pulsecht1.Series(series1);
temp.AddXY(-0.77, -0.05, (LPCTSTR) "", clTeeColor);
temp.AddXY(-0.23, -0.05, (LPCTSTR) "", clTeeColor);
temp.AddXY(-0.23, 0.5, (LPCTSTR) "", clTeeColor);
temp.AddXY(-0.15, 0.95, (LPCTSTR) "", clTeeColor);
temp.AddXY(0, 0.95, (LPCTSTR) "", clTeeColor);
temp.AddXY(0.15, 0.9, (LPCTSTR) "", clTeeColor);
temp.AddXY(0.23, 0.5, (LPCTSTR) "", clTeeColor);
temp.AddXY(0.23, -0.45, (LPCTSTR) "", clTeeColor);
temp.AddXY(0.46, -0.45, (LPCTSTR) "", clTeeColor);
temp.AddXY(0.66, -0.2, (LPCTSTR) "", clTeeColor);
temp.AddXY(0.93, -0.05, (LPCTSTR) "", clTeeColor);
temp.AddXY(1.16, -0.05, (LPCTSTR) "", clTeeColor);
long series2 = pulsecht1.AddSeries(scLine);
temp = pulsecht1.Series(series2);
temp.AddXY(-0.77, 0.05, (LPCTSTR) "", clTeeColor);
temp.AddXY(-0.39, 0.05, (LPCTSTR) "", clTeeColor);
temp.AddXY(-0.27, 0.8, (LPCTSTR) "", clTeeColor);
temp.AddXY(-0.27, 1.15, (LPCTSTR) "", clTeeColor);
temp.AddXY(-0.12, 1.15, (LPCTSTR) "", clTeeColor);
temp.AddXY(0.0, 1.05, (LPCTSTR) "", clTeeColor);
temp.AddXY(0.27, 1.05, (LPCTSTR) "", clTeeColor);
temp.AddXY(0.35, -0.07, (LPCTSTR) "", clTeeColor);
temp.AddXY(0.93, 0.05, (LPCTSTR) "", clTeeColor);
temp.AddXY(1.16, 0.05, (LPCTSTR) "", clTeeColor);
It seems as though nobody at Steema knows how to use TChart ActiveX v8.0 with MFC. No example ever sent by you even compiled. Why is that?
I want to be able to set the minimum values of the axes. The code you sent will not compile. Now please send me code that works.
pulsecht1.ClearChart();
CAspect temp1 = pulsecht1.get_Aspect();
temp1.put_View3D(FALSE);
long series1 = pulsecht1.AddSeries(scLine);
CSeries temp = pulsecht1.Series(series1);
temp.AddXY(-0.77, -0.05, (LPCTSTR) "", clTeeColor);
temp.AddXY(-0.23, -0.05, (LPCTSTR) "", clTeeColor);
temp.AddXY(-0.23, 0.5, (LPCTSTR) "", clTeeColor);
temp.AddXY(-0.15, 0.95, (LPCTSTR) "", clTeeColor);
temp.AddXY(0, 0.95, (LPCTSTR) "", clTeeColor);
temp.AddXY(0.15, 0.9, (LPCTSTR) "", clTeeColor);
temp.AddXY(0.23, 0.5, (LPCTSTR) "", clTeeColor);
temp.AddXY(0.23, -0.45, (LPCTSTR) "", clTeeColor);
temp.AddXY(0.46, -0.45, (LPCTSTR) "", clTeeColor);
temp.AddXY(0.66, -0.2, (LPCTSTR) "", clTeeColor);
temp.AddXY(0.93, -0.05, (LPCTSTR) "", clTeeColor);
temp.AddXY(1.16, -0.05, (LPCTSTR) "", clTeeColor);
long series2 = pulsecht1.AddSeries(scLine);
temp = pulsecht1.Series(series2);
temp.AddXY(-0.77, 0.05, (LPCTSTR) "", clTeeColor);
temp.AddXY(-0.39, 0.05, (LPCTSTR) "", clTeeColor);
temp.AddXY(-0.27, 0.8, (LPCTSTR) "", clTeeColor);
temp.AddXY(-0.27, 1.15, (LPCTSTR) "", clTeeColor);
temp.AddXY(-0.12, 1.15, (LPCTSTR) "", clTeeColor);
temp.AddXY(0.0, 1.05, (LPCTSTR) "", clTeeColor);
temp.AddXY(0.27, 1.05, (LPCTSTR) "", clTeeColor);
temp.AddXY(0.35, -0.07, (LPCTSTR) "", clTeeColor);
temp.AddXY(0.93, 0.05, (LPCTSTR) "", clTeeColor);
temp.AddXY(1.16, 0.05, (LPCTSTR) "", clTeeColor);
It seems as though nobody at Steema knows how to use TChart ActiveX v8.0 with MFC. No example ever sent by you even compiled. Why is that?
I want to be able to set the minimum values of the axes. The code you sent will not compile. Now please send me code that works.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi marathoner,
I've just sent you a VC++.NET example using SetMinMax.
Hope this helps!
I've just sent you a VC++.NET example using SetMinMax.
Hope this helps!
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 |
-
- Newbie
- Posts: 35
- Joined: Wed Dec 12, 2007 12:00 am
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi marathoner,
The project I sent already uses MFC. If you open project's option you'll see Use MFC in a Shared DLL option enabled at Use of MFC.
The project I sent already uses MFC. If you open project's option you'll see Use MFC in a Shared DLL option enabled at Use of MFC.
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 |