Writing code to Plot Points

TeeChart for ActiveX, COM and ASP
marathoner
Newbie
Newbie
Posts: 35
Joined: Wed Dec 12, 2007 12:00 am

Post by marathoner » Thu Dec 20, 2007 6:59 pm

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 ==========

marathoner
Newbie
Newbie
Posts: 35
Joined: Wed Dec 12, 2007 12:00 am

Post by marathoner » Thu Dec 20, 2007 7:12 pm

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?

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

Post by Pep » Fri Dec 21, 2007 10:58 am

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:

Code: Select all

   m_Chart1.AddSeries(scBar);
   CSeries bar1 = m_Chart1.Series(0);
   bar1.FillSampleValues(20); 

marathoner
Newbie
Newbie
Posts: 35
Joined: Wed Dec 12, 2007 12:00 am

Post by marathoner » Sat Dec 22, 2007 1:39 am

Why weren't those files in the project that was sent to me?

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

Post by Pep » Mon Dec 24, 2007 10:37 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.

marathoner
Newbie
Newbie
Posts: 35
Joined: Wed Dec 12, 2007 12:00 am

Post by marathoner » Thu Jan 03, 2008 1:29 pm

With this latest code, how do I set the attribute of the series to be a 2-D line graph? Also, how do I set the minimum and maximum x and y values of the graph?

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 Jan 03, 2008 2:36 pm

Hi marathoner,

You can set chart to 2D using this:

Code: Select all

	m_Chart1.GetAspect().SetView3D(false);
For setting axes minimum and maximum values use this:

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
Image Image Image Image Image Image
Instructions - How to post in this forum

marathoner
Newbie
Newbie
Posts: 35
Joined: Wed Dec 12, 2007 12:00 am

Post by marathoner » Fri Jan 04, 2008 5:25 pm

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.

marathoner
Newbie
Newbie
Posts: 35
Joined: Wed Dec 12, 2007 12:00 am

Post by marathoner » Fri Jan 04, 2008 9:50 pm

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.

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 Jan 17, 2008 1:39 pm

Hi marathoner,

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
Image Image Image Image Image Image
Instructions - How to post in this forum

marathoner
Newbie
Newbie
Posts: 35
Joined: Wed Dec 12, 2007 12:00 am

Post by marathoner » Mon Jan 21, 2008 3:31 pm

We are not using VC++.NET. We are using VC++ with MFC on VS2005

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 22, 2008 1:10 pm

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.
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

Post Reply