Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Graphs in VFP5
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Divers
Thread ID:
00116719
Message ID:
00120444
Vues:
13
Jorge,

I found the easiest way is to embed to graph in a general field with
a predefined format, so that you don't have to customize them via code (which is complicated, to say the least.) Then just link the general field on the form to the olecontrol and populate it with data.

The following code takes values based on time of day, and
plots a graph. The formatting of the graph is pre-set in
a table with 1 field (general), this allows you to only worry
about the data.

The nicest thing about this approach is that if the user has
Microsoft Office installed, they can edit and customize the graph
once displayed. You can then save their modified version back to
the general field and use that for future graphs.

* Begin Code Sample

cGraphString = "" + chr(9) + "TIME OF DAY" + chr(13)
For nCnt = 0 to 23
LOCATE FOR VAL(TTIME) = nCnt
if ncnt = 0
tod = '12a'
else
if ncnt = 12
tod = alltrim(str(ncnt)) + 'p'
else
if ncnt < 13
tod = alltrim(str(ncnt)) + 'a'
else
tod = alltrim(str(ncnt-12)) + 'p'
endif
endif
endif
IF FOUND()
cGraphString = cGraphString + tod + chr(9) + alltrim(str(ttl)) + chr(13)
else
cGraphString = cGraphString + tod + chr(9) + "0" + chr(13)
ENDIF
EndFor
SELECT TOGRAPH
APPEND GENERAL GRAPH DATA cGraphString
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform