Page 1 of 5

Need sample code to draw Histogram Series in VC++ (MFC)

Posted: Thu Jan 03, 2008 11:20 am
by 13047077
I need to add TeeChart control to draw "Histogram Series" in one of my VC++(MFC) application.I found information to draw "Histogram Series" for .NET applications , but that is not useful for me because I want to write application in VC++(MFC).

So could you please send me VC++(MFC) or C++ sample code or any help information to draw "Histogram series" using TeeChart control ?

Posted: Thu Jan 03, 2008 11:39 am
by narcis
Hi Frances,

You can either use a histogram series:

Code: Select all

	m_Chart1.AddSeries(scHistogram);
	m_Chart1.Series(0).FillSampleValues(8);
or a histogram function:

Code: Select all

	m_Chart1.AddSeries(scLine);
	m_Chart1.AddSeries(scBar);

	m_Chart1.Series(0).FillSampleValues(8);		
	
	m_Chart1.Series(1).SetDataSource(COleVariant("Series0"));
	m_Chart1.Series(1).SetFunction(41); //tfHistogram
	m_Chart1.Series(1).GetMarks().SetVisible(true);
	//m_Chart1.Series(1).GetFunctionType().SetPeriod(0);
	m_Chart1.Series(1).CheckDataSource();
For further information about VC++ applications with TeeChart please read Tutorial 15 - MS VC++ Applications and have a look at the examples at C:\Program Files\Steema Software\TeeChart Pro v8 ActiveX Control\Examples\Visual C++. I also recommend you to have a look at Tutorial 7 - Working with Functions.

Posted: Thu Jan 03, 2008 11:57 am
by 13047077
Could you please let me know where I will get these tutorial applications?

Posted: Thu Jan 03, 2008 12:01 pm
by 13047077
Hi ,

I also need sample code to draw Histogram Series polygon in MS VC++ application . and how to set color for each point in Histogram Series.

Posted: Thu Jan 03, 2008 12:14 pm
by narcis
Hi Frances,

You'll find the tutorials and examples at TeeChart's program group at Start Menu->All Programs.

Posted: Thu Jan 03, 2008 12:17 pm
by 13047077
Hi ,

Thanks for reply.
I am having examples and tutorial for .NET not for MS VC++ Applications . Please send me examples and tutorials for MS VC++.

Posted: Thu Jan 03, 2008 12:27 pm
by narcis
Hi Frances,

Which TeeChart for version are you using? The examples and tutorials I mentioned belong to TeeChart Pro v8 ActiveX as you posted to the forum for this TeeChart version.

Posted: Thu Jan 03, 2008 12:34 pm
by 13047077
Thanks for reply..

Tee Chart Version I am using is that 5.0.6.0...

Posted: Thu Jan 03, 2008 12:35 pm
by 13047077
Version that I am using TeeChart Pro Activex v5.0.6.0

Posted: Thu Jan 03, 2008 12:38 pm
by narcis
Hi Frances,

Ok, in that case you should have the tutorials in the location I mentioned. Examples should be found at C:\Program Files\TeeChart Pro v5 ActiveX Control\Examples\Visual C++ (Default English installation). However, with this version, you'll only have histogram series, histogram function support was added for TeeChart Pro v8 ActiveX.

Posted: Thu Jan 03, 2008 12:59 pm
by 13047077
Hi ,

I have only TeeChart5.ocx file present on my system for "TeeChart Pro Activex v5.0.6.0" version .

Could you please send me installer for TeeChart Pro Activex v5 so I can get MS VC++ examples and tutorial for this perticualr version after installing this vesion ActiveX on my system. I don't have a

"C:\Program Files\Steema Software\TeeChart Pro v5 ActiveX Control\Examples\Visual C++" folder on my system.

Posted: Thu Jan 03, 2008 1:13 pm
by narcis
Hi Frances,

You should find the installer at the client download area using your licensing details.

If you don't have this information please contact our Sales Dept. at sales@steema.com. If you purchased your license via a software reseller you may want to contact them.

Posted: Fri Jan 04, 2008 4:32 am
by 13047077
I am drawing histogram using Tee Chart . Could you please let me know how I will draw Polygons of histogram and how I will fill colors in that polygons.

Please give me smaple code example for above queries.

Posted: Fri Jan 04, 2008 8:27 am
by narcis
Hi Frances,

Sorry but I don't understand what do you exactly mean. Could you please give us more detailed information about what you are trying to achieve?

Thanks in advance.

Posted: Fri Jan 04, 2008 10:30 am
by 13047077
Hi ,

I am developing one application in which I want to draw Line and Histogram series using TeeChart5.ocx. This I want to develop in MS VC++ technology. I am having TeeChart5.ocx , that I have used in my application to use TeeChart functionlity.

Now I am okey to draw line series using TeeChart . but I am not able to understanding how I will draw Histogram using TeeChart .

I am having four coordinates i.e left , right , top , bottom to draw histogram but I don't know which are the methods or properties required to draw histogram series. also I don't know how to fill color in histogram series.

So could you please send me some sample code for MS VC++ technology which contains example to draw histogram series using Teechart activeX .


You had suggested me to use following,

For further information about VC++ applications with TeeChart please read Tutorial 15 - MS VC++ Applications and have a look at the examples at C:\Program Files\Steema Software\TeeChart Pro v8 ActiveX Control\Examples\Visual C++. I also recommend you to have a look at Tutorial 7 - Working with Functions

but I don't have these materials on my machine .

So this my request if you could send me MS VC++sample code to draw histogram series using TeeChart5.ocx component , this will be very helpful for me to complete my assignment.