Jump to content

Excel charts


Recommended Posts

Hello,

I try to create an Excel chart and set the XValues with a range of cells but it doesn't work.

Here is the code I use, the chart is Ok, the position and the title too but not the Xlabel.

$objExcel.Charts.Add()
$objExcel.ActiveChart.ChartType = $xlLine;Lignes.
$objExcel.ActiveChart.SetSourceData ($objExcel.Worksheets($xlFeuilleOrdi).Range("E2:E" & String($xlLigDonnes)), 2) $objExcel.ActiveChart.SeriesCollection(1).XValues = "=ACACIA!R2C1:R1000C1"
$objExcel.ActiveChart.Location ($xlLocationAsObject, $xlFeuilleAnalyse)
With $objExcel.ActiveChart
    .HasTitle = True
    .HasLegend = False
    .ChartTitle.Characters.Text = $xlFeuilleOrdi & " : utilisation réseau"
    .Parent.Top = $objExcel.ActiveSheet.Range("D" & String($xlLig)).Top
    .Parent.Left = $objExcel.ActiveSheet.Range("D" & String($xlLig)).Left
    .Parent.Name = $xlFeuilleOrdi & "_Graph_Réseau"
EndWith

I'm searching a solution since a lot of days but anything works. I didn't find solution on the forum.

I tried the Kerros' function without success.

Thanks for your help.

Alain.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...