Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Microsoft Graph
Message
De
06/11/1998 09:50:05
 
 
À
05/11/1998 18:46:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00154251
Message ID:
00155203
Vues:
27
>>>I think Flores' answer is excellent; I use that method(?) too.
>>>However I have more tip and question about implementing M.S graph.
>>>
>>>Tip1.
>>> ** Using Autoformat property.
>>>
>>> If there is no predefined max value of data series, that is to say whenever a your makes
>>> graph in applications the max value fluctuate emensely, user may get stupid graphs that
>>> every data value for graph exceed the max limit of predefined graph in Gen field.
>>>
>>> Autoformat property can solve this problem.
>>>
>>> < code omitted >
>>>
>>> Use Utiltable
>>> Append General gen_1 DATA m.Cgdata ** m.Cgdata ; data series
>>>
>>> Thisform.oleboundcontrol1.ControlSource = " gen_1"
>>>
>>> Thisform.oleboundcontrol1.autoformat(n,m)
>>>
>>> The combination of numbers n,m in autoformat(n,m) decide which types of graph it would be
>>> and you don't have to worry about the value of X,Y axies. But the combination is also predefined
>>> that if you issue the wrong combination it can cause an error.
>>>
>>>Tip2. Covering Oleobject with transparent shape object.
>>> This can prevent users from making dubleclick event on the Oleobject; in case Activating
>>> Ole server application is not desirable.
>>>
>>>My Question.
>>>
>>> A client PC has no M.S graph and M.S graph runtime is included in the setup procedure. But
>>> the graph in application is not working. Does anyone know why ?
>>>
>>> Thanks in advance.
>>You're right about that problem that can arise when predefined graph is given a larger set of values than the test data you use. I mentioned that approach as quick and dirty solution for John's problem. I also stated I had to go to OLE automation to get a better grip on the layout of a graph. You've made a good point on using the autoformat method of MS-Graph. But even this does not give you the solution to everything a user may ask for.
>> In addition to your number 2 tip, you can also set the OLE bound control Enabled property to .F., to prevent users from double-clicking on it and activating another application.
>
>Could someone give me a simple example of the process of autoformat and the test data approach you are talking about. I am using vfp3.0 does that make a difference? What about a little boost on the ole automation approach? Thanks guys...
>
>jd
Here's one example:
#Define xlArea 1
#Define xlShowLabel 4
#Define xlHigh -4127
#Define xlUpward -4171
Use Chart      && Table contains one general field called mschart.
Blank Fields mschart
Append General mschart Class MSGraph
oDummy = CreateObject("Form")
With oDummy
  .Height = 420
  .Width = 620
  .AddObject("oGraph","OleBoundControl")
  .ControlBox = .F.
  .AutoCenter = .T.
  .Caption = "Year-To-Date Chart"
  .Show
EndWith
Append General mschart Data lcData  && lcData has been given data
oDummy.Refresh()                    && you can check help file in how to
With oDummy.oGraph                  && format a string to pass to MSGraph
  .Top = 1
  .Left = 1
  .Height = 400
  .Width = 600
  .AutoActivate = 0
  .ControlSource="chart.mschart"
  .Visible = .T.
  .HasLegend = .f.
  .AutoFormat(xlArea, 1)
  .HasTitle = .f.
  .Axes(2).ReversePlotOrder = .T.
  .Axes(2).TickLabels.NumberFormat = "##0K"
  .Axes(1).TickLabelPosition = xlHigh
  .Axes(1).TickLabels.NumberFormat = "mmm-yy"
  .Axes(1).TickLabels.Orientation = xlUpward
  .Axes(1).TickLabels.Font.Size = 8
EndWith
oDummy.Refresh()
Just a cross-section of a working program I have. You will have to add your code for formatting the data appended to the general field at the beginning, as well as cleanup code at the end. You can find more details on the MS-Graph object model in C:\Your_Windows_Dir\msapps\msgraph5\vba_grp.hlp.HTH
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform