vfp graph

  • Thread starter Thread starter Dave Dawson
  • Start date Start date
D

Dave Dawson

I need to do some pie and column charts in vfp. I need to be able to
specify the color of each pie section or column. Is that possible with
msgraph?

If it is, does good documentation exist anywhere for msgraph?

I'm 62 years old, (probably just too damned old and crotchety) and have been
programming off and on for the last 40 years...sometimes for a living. It
gets very frustrating to go to supposed documentation or help files and
learn next to nothing from them. Most seem to be written especially for
someone who already knows how it works.

Seems to me that documentation, same as software, should go through beta
testing...with people who don't already know the answers.

Thanks,
Dave
 
Dave -

Dumb question: VFP = FoxPro? Then you ought to be able to hack your way through this
issue. I found some web resources that show how to use MS Graph (or even Excel) from
FoxPro, using VBA to access the chart's object model:

http://www.tedroche.com/Present/2003/ADX304.html
http://www.dfpug.de/loseblattsammlung/migration/whitepapers/advauto.htm

If you get stuck, you can use the object browser in the VB Editor to explore the MSG
object model, or find other examples around the web.

The PowerPoint FAQ (http://pptfaq.com) pages contain information and links about
automation of MSG.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______
 
Thank you, Jon.

Your post has a wealth of information. Yes, vfp does refer to Visual FoxPro
in this case.

I'm still feeling like an idiot. Why does it have to be so damned hard to
learn how to programmatically make a specific column in a column chart, or a
specific pie piece in a pie chart appear as a specific color?

Surely I'm not the first person in the world to have wanted to do that. If
the object browser or help file has that information, I haven't yet been
smart enough to ferret it out. I have also searched excel help and excel
vbe help to no avail.

I do recognize that I may be losing it, however, it isn't readily apparent
from all the other things I do.

I understand also that you probably didn't create the supposed documentation
for msgraph, and shouldn't have to put up with my frustrations. I don't
know how to take the frustrations to the people who are responsible (or
irresponsible) for agravating them.

If I am just obviously too stupid to find the information from what I've
been presented, please tell me that too, and I'll seriously consider getting
in another line of work.

If there is an actual representative of Microsoft on this forum, please tell
me if Microsoft even gives a damn that a reasonably intelligent person has
this much difficulty finding information that it seems to me should be
readily available.

Thanks,
Dave

****************
 
Programming for MS Graph through another application doesn't allow you
the benefit of Excel's macro recorder. Some of the object model is the
same, so if you recorded a macro in Excel, then made the necessary
adjustments, you could probably get it figured out.

You have to keep digging through the object model, which has a tree
something like this:

MSGraph Application
+Chart
+SeriesCollection
+Series
+Points
+Point
+Interior
+Color

and you can set a color using RGB(red,green,blue). The command would
look something like this:

With chtMSGraph
' defined differently within each parent app
.SeriesCollection(1).Points(2).Interior.Color = RGB(255,0,0)
End With

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______
 
Hi Dave,

As Jon suggested, use Excel's macro recorder and then work with the code it
creates. You'll have to check the object model to turn the VBA named
parameters into the parameter list you need to pass from VFP.

Have you read "Microsoft Office Automation with Visual FoxPro" by Tamar
Granor and Della Martin? It's available from www.hentzenwerke.com as well as
popular online bookstores.
 
Back
Top