Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Substitution for MsGraph5.ChartWizard
Message
De
08/07/1998 09:15:05
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
08/07/1998 06:05:03
Andrzej Majlich
Vulcan sp. z o. o.
Wroclaw, Pologne
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00115198
Message ID:
00115230
Vues:
15
>I'm printing a chart based on reported data. It was configured for msgraph5 and utilized msgraph5.ChartWizard() method. The method is missing in msgraph8 interface. I'm trying to find the properties which were set by ChartWizard, to do the work.
>I can't find any clue neither in MSDN, KB and elsewhere.
>Parameters Property
> source ControlSource
> gallery chart.Type (?)
> format chart.SubType
> plotby ????????? most needed !!!
>
>I've found that the Chart object has the 'plotby' property but only in VB. VFP doesn't see it.
>
>Help Please !!!
Hi Andrzej,
MSGraph8 closely tight to excel8 PEM. All data is in vbagrp8.hlp and vbaxcl8.hlp in ..\Microsoft Office\Office if VB help is installed. Plotby is seen by VFP too but syntax is like oForm.oGraph.object.application.plotby = 1 && or 2. You can use below example doing some minor modification to use msgraph8.
*!*	Below example is for Graph8. 
*!*	xlConstants can be found by :
*!*	-Open Excel
*!*	-Select tools\macro\VB editor
*!*	-Press F2 to bring up "Object browser"
*!*	-Find needed xlConstant type ie:xlChartType
*!*	-On right window click needed Constant ie: xl3DArea
*!*	-Below the window constant value is displayed
*!*	-Rather kludgy but currently the only way I know to find them
*!* cetin@neptune.imst.deu.edu.tr

******************************************
* xlChartType constants
* Extracted from Object browser
* 05/21/1998
* cetin@neptune.imst.deu.edu.tr
#define xl3DArea 					-4098
#define xl3DAreaStacked 			78
#define xl3DAreaStacked100 			79
#define xl3DBarClustered 			60
#define xl3DBarStacked 				61
#define xl3DBarStacked100 			62
#define xl3DColumn					-4100
#define xl3DColumnClustered			54
#define xl3DColumnStacked			55
#define xl3DColumnStacked100		56
#define xl3DLine					-4101
#define xl3DPie						-4102
#define xl3DPieExploded				70
#define xlArea						1
#define xlAreaStacked				76
#define xlAreaStacked100			77
#define xlBarClustered				57
#define xlBarOfPie					71
#define xlBarStacked				58
#define xlBarStacked100				59
#define xlBubble					15
#define xlBubble3DEffect			87
#define xlColumnClustered			51
#define xlColumnStacked				52
#define xlColumnStacked100			53
#define xlConeBarClustered			102
#define xlConeBarStacked			103
#define xlConeBarStacked100			104
#define xlConeCol					105
#define xlConeColClustered			99
#define xlConeColStacked			100
#define xlConeColStacked100			101
#define xlCylinderBarClustered		95
#define xlCylinderBarStacked		96
#define xlCylinderBarStacked100		97
#define xlCylinderCol				98
#define xlCylinderColClustered		92
#define xlCylinderColStacked		93
#define xlCylinderColStacked100		94
#define xlDoughnut					-4120
#define xlDoughnutExploded			80
#define xlLine						4
#define xlLineMarkers				65
#define xlLineMarkersStacked		66
#define xlLineMarkersStacked100		67
#define xlLineStacked				63
#define xlLineStacked100			64
#define xlPie						5
#define xlPieExploded				69
#define xlPieOfPie					68
#define xlPyramidBarClustered		109
#define xlPyramidBarStacked			110
#define xlPyramidBarStacked100		111
#define xlPyramidCol				112
#define xlPyramidColClustered		106
#define xlPyramidColStacked			107
#define xlPyramidColStacked100		108
#define xlRadar						-4151
#define xlRadarFilled				82
#define xlRadarMarkers				81
#define xlStockHLC					88
#define xlStockOHLC					89
#define xlStockVHLC					90
#define xlStockVOHLC				91
#define xlSurface					83
#define xlSurfaceTopView			85
#define xlSurfaceTopViewWireframe	86
#define xlSurfaceWireframe			84
#define xlXYScatter					-4169
#define xlXYScatterLines			74
#define xlXYScatterLinesNoMarkers	75
#define xlXYScatterSmooth			72
#define xlXYScatterSmoothNoMarkers	73
*******************************
#DEFINE TAB CHR(9)
#DEFINE CRLF CHR(13)+CHR(10)


create cursor test (degree i, sine n(8,4) NULL, cosine n(8,4))
for ix = 1 to 90
	insert into test ;
	  values ;
	  (ix,cos(ix)*ix,sin(ix)*ix)
endfor 
45
scan next 30     && Nullify 30 degrees
	replace sine with .null.       && Nullify some values to see effect
endscan

* Data prepare - Slower *
* MCGDATA = " "   && Initialize with one empty cell - if will fill in object.Datasheet
* Data prepare - Slower *

* VFP preparing data is much faster
* Try commenting this part (between * Data prepare * labels) 
* and uncommenting the commented part (between * Data prepare - Slower * labels)

* Data prepare *
wait window nowait "Filling cell values..."
MCGDATA = ""
nCols = fcount()
for ix = 1 to nCols
	MCGDATA = MCGDATA + iif(empty(MCGDATA),"",TAB)+field(ix)
endfor
MCGDATA = MCGDATA + CRLF
scan
	for ix = 1 to nCols
		MCGDATA = MCGDATA + iif(ix=1,"",TAB)+nvl(str(evaluate(field(ix))),"")
	endfor
	MCGDATA = MCGDATA + CRLF
endscan
* Data prepare *

create cursor testgen (genfld1 g)
append blank
append general genfld1 class "msgraph" data MCGDATA
***
* Now we have Graph object in gen field. (Graph8)
* Play with it

oForm = createobject("Form")
with oForm
	.height = 400
	.width = 600
	.show
	
	.addobject("myGraph","OleBoundControl")
	.addobject("myQuit1","myQuit")
	
	with .myGraph
		.height = oForm.height - 20
		.width = oForm.width 
		.left = 0
		.top = 0
		.ControlSource = "testgen.Genfld1"

* Data prepare - Slower *
*!*         FILLING DATA IN OBJECT DATASHEET
*!*			wait window nowait "Filling cell values..."
*!*			with .object.application.datasheet
*!*				select test
*!*				nRows = reccount()+1
*!*				nCols = fcount()
*!*				for ix = 1 to nCols
*!*					.Cells(1,ix).Value = field(ix)
*!*				endfor
*!*				scan
*!*					for ix = 1 to nCols
*!*						if !isnull(evaluate(field(ix)))
*!*							.Cells(recno()+1,ix).Value = evaluate(field(ix))
*!*						endif
*!*					endfor
*!*				endscan
*!*			endwith
* Data prepare - Slower *

		wait window nowait "Plotting..."
		.hastitle = .t.
		.haslegend = .t.
		.ChartTitle.caption = "This is chart title"
		.ChartType=xl3DArea
		.object.application.plotby = 2
		#define xlCategory		1
		#define xlValue			2
		#define xlSeriesAxis	3
		With .Axes(xlCategory)
		    .HasTitle = .t.
		    with .AxisTitle
			    .Caption = "This is category title"
			    .Font.Name = "Arial"
			    .Font.Size = 10
			    .Font.Bold = .t.
		    endwith
    	EndWith
		With .Axes(xlSeriesAxis)
		    .HasTitle = .T.
		    with .AxisTitle
			    .Caption = "This is SeriesAxis title"
			    .Font.Size = 8
			    .Font.Bold = .f.
			    .Orientation = 90 && Show 90 degrees rotated
		    endwith
    	EndWith
		With .Axes(xlValue)
		    .HasTitle = .T.
		    with .AxisTitle
			    .Caption = "This is Value title"
			    .Font.Size = 10
			    .Font.Bold = .f.
			    .Orientation = -90 && Show 90 degrees rotated - clockwise
		    endwith
    	EndWith
		wait clear
		.visible=.T.
	endwith
	.myQuit1.visible = .t.
endwith
read events

define class myquit as commandbutton
left=1
top=1
Caption="Close"
procedure click
    release all
	clear events

endproc
enddefine
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform