Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Nondefault Charts in Reports

Status
Not open for further replies.

Headwinds

Programmer
Feb 6, 2001
38
0
0
US
I'm trying to make a report that prints a chart in a format other than the default. I'd like to (1) cause the chart to be a line graph instead of a bar chart, (2) drop the legend, and (3) show the values on the X-Axis.

The following BeforeOpenTables method of my report charts the data from a cursor called cCount, but it takes all of the MS Chart defaults. It displays cCount.counts on the Y-axis, but provides a differently colored bar for each corresponding value of cCount.postmark. There is a legend on the right side of the chart showing which color corresponds to which X value. The X values are not displayed on the X-axis.
Code:
SELECT cCount
*!*	Load the chart.
#DEFINE CRLF CHR(13) + CHR(10)
#DEFINE TAB CHR(9)
LOCAL My_Data
My_Data = "" + CRLF
SCAN
  My_Data = My_Data + DTOC(cCount.postmark)
  My_Data = My_Data + TAB 
  My_Data = My_Data + LTRIM(STR(cCount.counts)) + CRLF
ENDSCAN
SELECT graphs
APPEND GENERAL olegraph CLASS "msgraph.chart" DATA My_Data
 
Headwinds

I noticed your code comes from the "solutions" samples. But once the chart is loaded on the form, if you edit the chart (dblclick on it), and load up the chart menu, and change the chart style to whatever you want, it seems to save the settings for the next time. In order words, once I changed the chart style in the solution sample, and close VFP (VFP7.0) and come back to it, it seems to have saved the last settings of the chart. Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top