Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to add ms-excel
Message
From
02/12/2003 04:13:17
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
02/12/2003 03:31:28
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00854922
Message ID:
00854936
Views:
21
>hi Cetin,
> i want only to insert a simple graph for my forcasting program, do you have any suggestions how to preview a graph into the form.
>
>thanks.

Oh my :) You should ask that way before.
Then either :
-Use native fox controls (Line,.Line etc)
-MSChart2.0 activex (search for sample code here)
-OWC chart control (check west-wind.com for samples)
-MsGraph (samples here and solution.app)
-Excel charting (but not on form FWIW)

A simple MSChart2.0 sample :
oForm=createobject('form1')
oForm.Show
Read events

#INCLUDE "mschrt20.h"
Define CLASS form1 AS form
  Top = 0
  Left = 0
  Height = 520
  Width = 790
  DoCreate = .T.
  Name = "Form1"

  Add OBJECT mschart AS olecontrol WITH ;
    Top = 10, ;
    Left = 5, ;
    Height = 500, ;
    Width = 780, ;
    Name = "MsChart", ;
    OleClass = 'MSChart20Lib.MsChart'

  Procedure Init
    Select country,sum(maxordamt) ;
    	from customer ;
    	group by 1 ;
    	into cursor crsChart
    lcTemp = Sys(2015)+".tmp"
    Copy To (lcTemp) type delimited with "" with tab
    _cliptext = FileToStr(m.lcTemp)
    Erase (m.lcTemp)
    Thisform.mschart.Editpaste
  Endproc

Procedure QueryUnload
	Clear events
endproc
Enddefine
PS: MSGraph and MSExcel are a little heavy to display charts on a form.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform