Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to put graph in a report
Message
De
25/08/2004 07:10:47
 
 
À
24/08/2004 22:49:38
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00934755
Message ID:
00936251
Vues:
25
Hello Evelyn.

i'm able now to show a pie chart in my form. problem now is, i do not know how to display the values of the rows in the pie chart? how can i do that? i'm using ms chart.

With MS Chart, you need to populate its dtagrid. If youir data is in a cursor called csrResults, your code would look like this:
LOCAL lnCol, lnRow
WITH THISFORM.oChart
  *** Set the number of fields in the cursor
  .ColumnCount = FCOUNT( 'csrResults' ) - 1
  *** Set the number of rows to the number of records in the cursor
  .RowCount = RECCOUNT( 'csrResults' )
  *** Populate the DataGrid Object.
  SELECT csrResults
  SCAN
    .Row = RECNO( 'csrResults' )
    *** Set up the label for the category axis
    .RowLabel = EVALUATE( FIELD[ 1 ] )
    *** Populate the data grid with the numeric data
    FOR lnCol = 1 TO .ColumnCount
      .Column = lnCol
      .Data = EVALUATE( FIELD( lnCol + 1 ) )
    ENDFOR
  ENDSCAN
  FOR lnCol = 1 TO .ColumnCount
    .Row = 1
    .Column = lnCol
    .ColumnLabel = ALLTRIM( FIELD( lnCol + 1 ) )
  ENDFOR
ENDWITH
You may want to look at a wrapper for MSChart that Mike Lewis has on his web site:

http://www.ml-consult.demon.co.uk/foxst-23.htm
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform