Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Data Labels on Graphs
Message
De
22/05/2003 08:29:28
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
21/05/2003 14:00:56
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00789156
Message ID:
00791538
Vues:
18
>Any other thoughts?
>
>.DataLabel.TOP doesn't work - I can see the various labels being selected and in VB it looks simple .SELECTION.TOP =
>
>It seems like is should be simple enough, but I can't seem to get it.

Strange didn't work for you. .DataLabel and .Selection there point to same object. This works quite well for me :
lcXLS = Sys(5)+Curdir()+'exceldatalabeltest.xls'

Create Cursor SampleData (ItemName c(10), v1 i, v2 i, v3 i)
For ix=1 To 10
  Insert Into SampleData Values ;
    ('Item'+Transform(ix), Rand()*100, Rand()*100, Rand()*100 )
Endfor
Copy To (lcXLS) Type Xls

#include xlconstants.h
*** set the LOCALEID to English
nlLocaleId=Sys(3004)		&& Save local id
=Sys(3006,1033)				&& We will be sending instructions in English
oExcel = Crea('excel.application')
With oExcel
  .workbooks.Open(lcXLS)
  With .ActiveWorkBook.ActiveSheet
    oChartRange = .UsedRange
    .ChartObjects.Add(200, 10, 500, 500)
    With .ChartObjects(1).Chart
      .SetSourceData(oChartRange, xlColumns)
      .hastitle = .T.
      .haslegend = .T.
      .ChartTitle.Caption = "Chart Title"
      .ChartType = xlColumnClustered
      * Show labels with leader lines
      .ApplyDataLabels(xlDataLabelsShowValue)
      *Set label positions
      For each oSeries in .SeriesCollection
        With oSeries
          .DataLabels.Orientation = xlUpward
          For each oPoint in .Points
            With oPoint.DataLabel
              .Top = .Top - 20
            EndWith
            oPoint = .null.
          Endfor
        EndWith
        oSeries = .null.
      Endfor
    Endwith
  Endwith
  .Visible = .T.
Endwith
=Sys(3006,Val(nlLocaleId))
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform