Click here to Skip to main content
13,141,109 members (50,777 online)
Click here to Skip to main content


165 bookmarked
Posted 31 Aug 2004

A 2D Graph Component With Zoom Capability

, 21 Dec 2004
A 2D graph component with zoom capability.
import "C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\include\prsht.idl";
import "C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\include\mshtml.idl";
import "c:\program files\microsoft visual studio .net 2003\vc7\platformsdk\include\dimm.idl";
import "C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\include\mshtmhst.idl";
import "c:\program files\microsoft visual studio .net 2003\vc7\platformsdk\include\docobj.idl";
import "C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\include\exdisp.idl";
import "C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\include\objsafe.idl";

	helpstring("ISmartGraph Interface"),
#line 26 "e:\\mine\\projects\\my articles sent to code project\\smartgraph\\smartgraph.h"
interface ISmartGraph : IDispatch {
#line 29 "e:\\mine\\projects\\my articles sent to code project\\smartgraph\\smartgraph.h"
	[propput,bindable,requestedit,id((-501))] HRESULT  BackColor([in] OLE_COLOR clr);
#line 31 "e:\\mine\\projects\\my articles sent to code project\\smartgraph\\smartgraph.h"
	[propget,bindable,requestedit,id((-501))] HRESULT  BackColor([out,retval] OLE_COLOR *pclr);
#line 33 "e:\\mine\\projects\\my articles sent to code project\\smartgraph\\smartgraph.h"
	[propput,bindable,requestedit,id((-503))] HRESULT  BorderColor([in] OLE_COLOR clr);
#line 35 "e:\\mine\\projects\\my articles sent to code project\\smartgraph\\smartgraph.h"
	[propget,bindable,requestedit,id((-503))] HRESULT  BorderColor([out,retval] OLE_COLOR *pclr);
#line 37 "e:\\mine\\projects\\my articles sent to code project\\smartgraph\\smartgraph.h"
	[propput,bindable,requestedit,id((-513))] HRESULT  ForeColor([in] OLE_COLOR clr);
#line 39 "e:\\mine\\projects\\my articles sent to code project\\smartgraph\\smartgraph.h"
	[propget,bindable,requestedit,id((-513))] HRESULT  ForeColor([out,retval] OLE_COLOR *pclr);
	[propget,id(1),helpstring("property Title")] HRESULT  Title([out,retval] BSTR *pVal );
	[propput,id(1),helpstring("property Title")] HRESULT  Title([in] BSTR newVal);
	[propget,id(2),helpstring("property xLable")] HRESULT  xLable([out,retval] BSTR *pVal );
	[propput,id(2),helpstring("property xLable")] HRESULT  xLable([in] BSTR newVal);
	[propget,id(3),helpstring("property yLable")] HRESULT  yLable([out,retval] BSTR *pVal );
	[propput,id(3),helpstring("property yLable")] HRESULT  yLable([in] BSTR newVal);
	[propget,id(4),helpstring("property Columns")] HRESULT  Columns([out,retval] LONG *pVal);
	[propput,id(4),helpstring("property Columns")] HRESULT  Columns([in] LONG newVal);
	[propget,id(5),helpstring("property Rows")] HRESULT  Rows([out,retval] LONG *pVal);
	[propput,id(5),helpstring("property Rows")] HRESULT  Rows([in] LONG newVal);
	[propget,id(6),helpstring("property MarginBottom")] HRESULT  MarginBottom([out,retval] LONG *pVal);
	[propput,id(6),helpstring("property MarginBottom")] HRESULT  MarginBottom([in] LONG newVal);
	[propget,id(7),helpstring("property MarginTop")] HRESULT  MarginTop([out,retval] LONG *pVal);
	[propput,id(7),helpstring("property MarginTop")] HRESULT  MarginTop([in] LONG newVal);
	[propget,id(8),helpstring("property MarginRight")] HRESULT  MarginRight([out,retval] LONG *pVal);
	[propput,id(8),helpstring("property MarginRight")] HRESULT  MarginRight([in] LONG newVal);
	[propget,id(9),helpstring("property MarginLeft")] HRESULT  MarginLeft([out,retval] LONG *pVal);
	[propput,id(9),helpstring("property MarginLeft")] HRESULT  MarginLeft([in] LONG newVal);
	[id(10),helpstring("method SetData")] HRESULT  SetData([in] DOUBLE *xData, [in] DOUBLE *yData, [in] LONG NumOfPoints, [in] VARIANT_BOOL bResample);
	[id(11),helpstring("method SetDataWithDetail")] HRESULT  SetData2([in] DOUBLE *xData, [in] DOUBLE *yData, [in] LONG NumOfPoints, [in] DOUBLE xMin, [in] DOUBLE xMax, [in] DOUBLE yMin, [in] DOUBLE yMax, [in] VARIANT_BOOL bResample);
#line 61 "e:\\mine\\projects\\my articles sent to code project\\smartgraph\\smartgraph.h"
	[id(12),helpstring("method ShowGrid")] HRESULT  ShowGrid([in] VARIANT_BOOL bShow);
	[id(13),helpstring("method UpdateGraph")] HRESULT  UpdateGraph();
	[id(14),helpstring("method SetPlotType")] HRESULT  SetPlotType([in] LONG nType);
	[id(15),helpstring("method GetPlotRect")] HRESULT  GetPlotRect([out] LONG *left, [out] LONG *top, [out] LONG *right, [out] LONG *bottom);
	[id(16),helpstring("method GetClientRect")] HRESULT  GetClientRect([out] LONG *left, [out] LONG *top, [out] LONG *right, [out] LONG *bottom);
	[id(17),helpstring("method ZoomIn")] HRESULT  ZoomIn([in] LONG FromSample, [in] LONG ToSample);
	[id(18),helpstring("method ZoomInByPercent")] HRESULT  ZoomInByPercent([in] DOUBLE FromPercent, [in] DOUBLE ToPercent);
	[id(19),helpstring("method ZoomOut")] HRESULT  ZoomOut();
	[id(20),helpstring("Resets graph view to original view"),helpcontext(20)] HRESULT  Reset();
	[id(21),helpstring("method GetDisplayedRange")] HRESULT  GetDisplayedRange([out] LONGLONG *nStartSample, [out] LONGLONG *nEndSample);
	[id(22),helpstring("method SetLegendText")] HRESULT  SetLegendText([in] BSTR strText, [in]LONG top, [in]LONG left, [in]LONG bottom, [in]LONG right);
	[id(23),helpstring("method SetParentWnd")] HRESULT  SetParentWnd([in] OLE_HANDLE hWnd);
	[id(24),helpstring("method GetPlotType")] HRESULT  GetPlotType([in]LONG *PlotType);

[ version(1.0), uuid(EF8E3F70-D54A-4B7D-A6EB-1D47794BEF45), helpstring("Graph 1.0 Type Library") ]
library Graph

		helpstring("_ISmartGraphEvents Interface")
#line 84 "e:\\mine\\projects\\my articles sent to code project\\smartgraph\\smartgraph.h"
	dispinterface _ISmartGraphEvents {

		[id(1),helpstring("method LButtonDown")] HRESULT  LButtonDown([in] LONG xPos, [in]LONG yPos, [in]LONGLONG wParam);
		[id(2),helpstring("method LButtonUp")] HRESULT  LButtonUp([in] LONG xPos, [in]LONG yPos, [in]LONGLONG wParam);
		[id(3),helpstring("method MouseMove")] HRESULT  MouseMove([in] LONG xPos, [in]LONG yPos, [in]LONGLONG wParam);

		helpstring("SmartGraph Class")
#line 103 "e:\\mine\\projects\\my articles sent to code project\\smartgraph\\smartgraph.h"
	coclass SmartGraph {
		interface ISmartGraph;
		[default, source]	interface _ISmartGraphEvents;


By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Hossein Khosravi
Software Developer (Senior)
Iran (Islamic Republic of) Iran (Islamic Republic of)
Currently I'm working at Dept. of Electrical Engineering in University of Shahrood.
Pattern Recognition (specially OCR), Neural Networks, Image Processing and Machine Vision are my interests. However I'm a PROGRAMMER as well.
BSc: Sharif University of technology @ 2002
MSc. and PhD: Tarbiat Modarres University @ 2006 & 2010 respectively

Personal Blog: Andisheh Online

Religious Blogs: Shia Muslims , Ashura , Islamic Quotes

Commercial Site: Farsi OCR

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.170915.1 | Last Updated 22 Dec 2004
Article Copyright 2004 by Hossein Khosravi
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid