* 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 EndwithPS: 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.