Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to put graph in a report
Message
From
25/08/2004 07:10:47
 
 
To
24/08/2004 22:49:38
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00934755
Message ID:
00936251
Views:
24
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
Previous
Reply
Map
View

Click here to load this message in the networking platform