Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to create chart
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00609721
Message ID:
00611211
Views:
26
This message has been marked as the solution to the initial question of the thread.
Should I create an array to store data and then use "=" to put data inside .Row, .Column and .Data?


No, you do not need to.
Use Row property to tell that you want to enter the value for a specific row (this stands for the first index of the "array")
Use Column property to tell that you want to enter the value for a specific column (this stands for the second index of the "array")
Use Data property to enter the value of the cell itself.





Could you tell me the command to make the data to a bar chart, please?


See the following topic in MSDN library:
ChartType Constants
http://msdn.microsoft.com/library/en-us/mschrt98/html/vbcstcharttypeconstants.asp

In addition to set the visual type of the chart you should use the ChartType Property - the values of the constants from the above topic are:
.ChartType = 0  && VtChChartType3dBar
.ChartType = 1  && VtChChartType2dBar
.ChartType = 2  && VtChChartType3dLine
.ChartType = 3  && VtChChartType2dLine
.ChartType = 4  && VtChChartType3dArea
.ChartType = 5  && VtChChartType2dArea
.ChartType = 6  && VtChChartType3dStep
.ChartType = 7  && VtChChartType2dStep
.ChartType = 8  && VtChChartType3dCombination
.ChartType = 9  && VtChChartType2dCombination
.ChartType = 14  && VtChChartType2dPie
.ChartType = 16  && VtChChartType2dXY
And here is sample, which I have adopted to VFP from the original VB code
The original VB code can be found at the MSDN:
MSChart Control Example
http://msdn.microsoft.com/library/en-us/mschrt98/html/vbobjvtchartobjectx.asp

In the Init of the MSChart Control put code like the following:
LOCAL lnColumn, lnRow, lnIndex1, lnIndex2, lnIndex3, lnIndex4

With This

*	Displays a 3d chart with 8 columns and 8 rows
*	data.
	.ChartType = 0  && VtChChartType3dBar - this will make a 3D Bar chart

	.ColumnCount = 8	&& This could be AFIELDS(laFieldsArray) of a cursor(table)
	.RowCount = 8	&& This could be RecCount() of a cursor(table)
	For lnRow = 1 To 8	&& This could be a Scan of the Cursor
		For lnColumn = 1 To 8	&& This could be For lnColumn = 1 to ALEN(laFieldsArray, 1)
			.Column = lnColumn
			.Row = lnRow
			.Data = lnRow * 10 &&Or something else e.g. EVALUATE(laFieldsArray(lnColumn, 1))
		EndFor
	EndFor
*	Use the chart as the backdrop of the legend.
	lnIndex1 = 0
	lnIndex2 = 0
	lnIndex3 = 0
	lnIndex4 = 0
	.ShowLegend = .T.
	.SelectPart(4, lnIndex1, lnIndex2, lnIndex3, lnIndex4) && VtChPartTypePlot
	.EditCopy
	.SelectPart(3, lnIndex1, lnIndex2, lnIndex3, lnIndex4) && VtChPartTypeLegend
	.EditPaste
EndWith
The other stuff I think it is your job - explore, invite, belive yourself!
Kind Regards
Zlatin Zlatev,
MCSD (VS6)

Make solutions, not programs!

Previous
Next
Reply
Map
View

Click here to load this message in the networking platform