Hi Bill,
Below is the code I use to produce the graphs. It is not much different
from yours. I don't use VFP report writer for this particular app. I use
the Virtual Print Engine (VPE -
http://www.idealsoftware.com/ev_main.htm). I am sure if JPG is created
with same name each time the VFP report writer will also work. Oh, I am
still using VFP7.
However, after looking at Cesar Chalom's "FoxCharts", I am wondering why
I even need to use ActiveX with in VFP? I think at some point I will
switch.
DECLARE aEnrlVal[1,1]
STORE 0 TO aEnrlVal
SELECT GRADE, SCHCHS, SCHMMS, SCHSO, SCHCLIN, SCHJEFF, SCHMARS, SCHSB,
SCHSM, SCHTUSC, SCHODP, ;
RPTASOF, ACAYEAR, 000000 AS Total ;
FROM (This.TableName) ;
INTO ARRAY aEnrlVal
cGrdList = ""
cDataList = ""
FOR i = 1 TO ALEN(aEnrlVal,1)
cGrdList = cGrdList + "*" + ALLTRIM(aEnrlVal[i,1])
aEnrlVal[i,14] = 0
FOR j = 2 TO 10
aEnrlVal[i,14] = aEnrlVal[i,14] + aEnrlVal[i,j]
ENDFOR
cDataList = cDataList + "*" + ALLTRIM(STR(aEnrlVal[i,14]))
ENDFOR
cGrdList = SUBSTR(cGrdList,2)
cDataList = SUBSTR(cDataList,2)
#INCLUDE rmchart.h
SET CLASSLIB TO rmchart ADDITIVE
oRMC = CREATEOBJECT("RMChart")
WITH oRMC.oChart
.Reset
.SetProperties(700, 400, RMC_CLR_Beige, RMC_CTRLSTYLE3DLIGHT,
"", "Tahoma", 0, 0, RMC_CLR_Default, RMC_CLR_Default)
************** Add Region 1 *****************************
.AddRegion
With .Region(1)
.SetProperties(5, 5, -5, -5, "")
************** Add caption to region 1 *******************
.AddCaption
With .Caption
.SetProperties("Enrollment Summary", RMC_Default,
RMC_Default, 10, .T.)
EndWith
************** Add grid to region 1
*****************************
.AddGrid
With .Grid
.SetProperties(RMC_CLR_FloralWhite, .T., 0, 0, 0, 0,
RMC_BICOLOR_NONE)
EndWith
************** Add data axis to region 1
*****************************
.AddDataAxis
With .DataAxis(1)
.SetProperties(RMC_DATAAXISLEFT, 0, 600, 16, 8,
RMC_Default, RMC_Default, RMC_LINESTYLESOLID, 0, "", "Students", "",
RMC_TEXTRIGHT)
EndWith
************** Add label axis to region 1
*****************************
.AddLabelAxis
With .LabelAxis
.SetProperties(1, 16, RMC_LABELAXISBOTTOM, 8,
RMC_Default, RMC_TEXTCENTER, RMC_Default, RMC_LINESTYLESOLID, "")
.LabelString = cGrdList
EndWith
************** Add legend to region 1
*******************************
.AddLegend
With .Legend
.SetProperties(RMC_LEGEND_TOP, RMC_Default,
RMC_LEGENDRECT, RMC_Default, 8, .F.)
.LegendString = "District = " +
ALLTRIM(STR(aEnrlVal[ALEN(aEnrlVal,1),14]))
EndWith
************** Add Series 1 to region 1
*******************************
.AddBarSeries
With .BarSeries(1)
.SetProperties(RMC_BARSINGLE, RMC_BAR_HOVER, .F.,
RMC_CLR_SteelBlue, .F., 1, RMC_VLABEL_DEFAULT, 1, RMC_HATCHBRUSH_OFF)
****** Set data values ******
*.SetDataFile "EnrlSum.csv","1,16","1",","
.DataString = cDataList
EndWith
EndWith
cFileName = "temp\enrlgrd.jpg"
nRetVal = .DRAW2FILE(cFileName)
ENDWITH
oRMC = NULL
Manjit
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Bill Arnold
Sent: Saturday, April 05, 2008 5:16 AM
To: [email protected]
Subject: RE: Manjit's RMChart Graph Example
Hi Manjit,
If you get a chance to post some sample VFP code that does this, it
would be appreciated.
Also, a minor 'heads up', but I'm not sure about this: after installing
RMChart/RMCDesigner (and another unrelated utility to inspect the
printer queue, on the same day), I started having problems with Norton
Ghost 9 (it went nuts on me and caused problems). This version of Ghost
is totally locked into .NET framework 1.1, so any change in that area
would cause a problem. I can't say for sure this is what happened, but
since I did run into this problem I thought I'd mention it.
Bill
> Bill, your right. I got "-5" error as well when I tried the
> "dj-dax-nasdaq.rmc" file. However, I am sure you already know
> this; there is no need to convert ASP code into VFP as long
> as you use the "RMC" files. These files can easily be created
> through the designer. Only thing you have to change are the
> data files. I am thinking of implementing this approach in my
> app because the graphs are not interactive. They are just
> printed on a report.
>
>
> Manjit
>
[excessive quoting removed by server]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.