Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to move legend in Ms-Chart ?
Message
De
26/10/2001 04:00:51
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
25/10/2001 17:50:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00572186
Message ID:
00573533
Vues:
26
This message has been marked as the solution to the initial question of the thread.
>How the VtChLocationTypeCustom constant location works ?
>Does I need to define the top and left positions somewhere ?
>Thank you.

Yes Marc,
You have to define. Location has a Rect property that points to its Rectangle. It has min.x, min.y, max.x, max.y properties. When setting keep in mind it doesn't use the screen coordinate system we're accustomed to but map system :) That's y=0 is bottom line of control not top :
* Put legend in top-right or bottom-right
lparameters tlTop
With ThisForm.MsChart
  lnCurHeight = .Height * 15
  lnCurWidth = .Width * 15
  With .Legend
    .Location.Visible = .t.
    .Location.LocationType = 8
    With .Location.Rect
      lnHgt = .Max.Y-.Min.Y
      lnWdt = .Max.X-.Min.X
      .Max.X = lnCurWidth
      .Min.X = lnCurWidth - lnWdt
      .Min.Y = iif(tlTop, lnCurHeight - lnHgt, 0)
      .Max.Y = iif(tlTop, lnCurHeight,lnHgt)
    Endwith
  Endwith
Endwith
PS: Chart uses points not pixels. 15 comes from 1440/96. 96 is aspect ratio (normally you'd want to get that from GetDeviceCaps api). 1440 is twips per inch and 1 pt=20 twips.
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform