Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to refresh MS Graph
Message
De
23/01/2001 10:50:54
 
 
À
23/01/2001 10:33:05
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00467192
Message ID:
00467331
Vues:
10
>Hi,
> I just need to change the chart type. The data in general field is same. Once I issue olegraph.autoformat(-4099,1) to change the chart type, the ole bound control don refresh the graph. It overlap the previous and latest chart.
>
>Any ideas?
>
>Thank you

From the MS website:
#DEFINE cr CHR(13)
   #DEFINE tab CHR(9)

   USE datafile IN 1
   USE grphfile IN 2
   SELECT datafile
   cGraphString = ""

   * Build tab-delimited string of field names:
   FOR iCounter = 1 TO 5
      cGraphString = cGraphString  + FIELDS(iCounter) ;
         + IIF(iCounter tab,cr)
   ENDFOR

   * Concatenate the data, converting numeric fields to character:
   SCAN
         FOR iCounter = 1 TO 5
         cGraphString = cGraphString  + IIF(TYPE(Fields(iCounter))='C',;
            EVALUATE(FIELDS(iCounter)) ;
            ,str(EVALUATE(FIELDS(iCounter)),16,2);
            );
            + IIF(iCounter tab,cr)
      ENDFOR
   ENDSCAN

   SELECT grphfile
   APPEND GENERAL mgraph DATA cGraphString 

NOTE: Under Windows 95 and Windows NT, adding the clause CLASS "MSGraph" to the 
* APPEND GENERAL command causes a new, default graph to be created regardless of any 
* existing graph or other type of object stored in the mgraph field 
* (including if it were empty). 
* You may pass data to a graph object without overwriting the existing formatting by 
* omitting the CLASS clause as above. 

* Using the following code in the above example creates a new graph 
* under Windows 95 or Windows NT, rather than placing the data into the existing graph: 

   APPEND GENERAL mgraph CLASS "MsGraph.Chart" DATA cGraphString
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform