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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Foxcharts graphic form on page frame error VFP 9 1

Status
Not open for further replies.

taterday

Programmer
Jan 28, 2009
183
US
Latest version of Foxcharts. I think it is great!

m.object.addproperty('_Original Width') .... addproperty not found

If I put the foxcharts on a form (pctform) and "do form pctform" from the page frame, the chart displays within the form at the top of the form that contains the page frame. I want to place the foxcharts on one of the page frame. Ideally to display when that page is activate. I have tried putting the code in the init and the activate. I get the same error.

The sample page frame is exactly what I want to do. I just don't see were mine is different.

I get the error above when the do the form that contains the page frame. Could someone tell me what I am doing wrong?

Thank you.
 
What is m.object?
Not every class - so also not every object - has an addproperty method you can call to add properties. Also spaces in property names are not allowed. This code can't work because of both errors.

Check out Addproperty(m.object,'_Original_Width', m.object.Width)

Bye, Olaf.
 
Hi Taterday,

in the projectmanager open your form, activate the pageframe rightclick to activate a shortcutmenu, select edit, click on the page which on which you want the graph to be shown, (now this page has a turquoise border), click on the class foxcharts and drop it on your page. From here you must make the code to activate / init and start your graph.
There is a sample form supplied with Foxcharts which has graphs on a pageframe which you can also study.

Regards,

Jockey(2)
 
I believe that is what I have done. I put the page frame in edit mode. dragged the same class.

Where could this being triggered?
There is an error message box
error number: 1734
line number : 4
statement: Addproperty(m.object,'_Original_Width', m.object.Width)


If I comment out these statements I do not get the errors. These are the statements that run correctly when using the do form ... putting them in the init event.


WITH THIS.FOXCHARTS1 AS FOXCHARTS OF "FoxCharts.vcx"
.SOURCEALIAS = "Pct1"
.CHARTSCOUNT = 1
.CHARTTYPE = 2 && 1 for pie chart
.AlphaChannel = 230
.ColorType = 14
.PieDetachAnimationSteps =30
.PieDetachSliceonClick = .T.
.PieEnhancedDrawing = .T.
.PieDetachSliceOnLegendClick = .T.

WITH .FIELDS(1)
.FIELDVALUE = "col1"
endwith
.FieldLegend = 'Row1'
.FieldAxis2='Row1'
.Depth = 20
.ColorType=1

.DRAWCHART()
ENDWITH

 
I don't see the connection, where in that cdode is your m.object? And again, what is it?

In regard to the newe code:
WITH THIS.FOXCHARTS1

Where is THIS located, what is THIS? If it'`s in a form method, that code will only work on a foxcharts put directly on the form, otherwise you need to adjust the object reference to eg THISFORM.PAGEFRAME1.PAGE1.FOXCHARTS1

Bye, Olaf.
 
I found where the error is coming from. It is a custom class that I have. I appreciate your help.

Thank you. You kept me from giving up and researching it further.
 
My 2c:

a SET STEP ON near the end of an error handler before you RETURN or RETRY is very helpful for debugging errors.

This allows you, without having a dedicated breakpoint set manually, to investiage further, after an error happend. You can eg inspect m.object in the watch window in this case...

Bye, Olaf.
 
Thank you again OlafDoschke. Very helpful.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top