Mise en forme graphe

  • Initiateur de la discussion Initiateur de la discussion ledaf
  • Date de début Date de début

Boostez vos compétences Excel avec notre communauté !

Rejoignez Excel Downloads, le rendez-vous des passionnés où l'entraide fait la force. Apprenez, échangez, progressez – et tout ça gratuitement ! 👉 Inscrivez-vous maintenant !

ledaf

XLDnaute Junior
Bonjour, voici le code que j'utilise:

Code:
Charts.Add
    ActiveChart.ChartType = xlColumnClustered
    ActiveChart.SetSourceData Source:=Sheets("Feuil2").Range(ch), PlotBy:=xlRows
    ActiveChart.SeriesCollection(1).Name = "=Feuil2!R3C1"
    ActiveChart.SeriesCollection(2).Name = "=Feuil2!R4C1"
    ActiveChart.SeriesCollection(3).Name = "=Feuil2!R5C1"
    ActiveChart.SeriesCollection(4).Name = "=Feuil2!R6C1"
    ActiveChart.SeriesCollection(5).Name = "=Feuil2!R7C1"
    ActiveChart.SeriesCollection(6).Name = "=Feuil2!R8C1"
    ActiveChart.SeriesCollection(7).Name = "=Feuil2!R9C1"
    ActiveChart.SeriesCollection(8).Name = "=Feuil2!R10C1"
    ActiveChart.Location Where:=xlLocationAsObject, Name:="Feuil2"
    With ActiveChart
        .HasAxis(xlCategory, xlPrimary) = True
        .HasAxis(xlValue, xlPrimary) = True
    End With
    ActiveChart.Axes(xlCategory, xlPrimary).CategoryType = xlAutomatic
    ActiveSheet.ChartObjects(1).Activate
    ActiveChart.Axes(xlCategory).Select
    With ActiveChart.Axes(xlCategory)
        .MinimumScaleIsAuto = True
        .MaximumScaleIsAuto = True
        .BaseUnitIsAuto = True
        .MajorUnitIsAuto = True
        .MinorUnitIsAuto = True
        .Crosses = xlAutomatic
        .AxisBetweenCategories = True
        .ReversePlotOrder = False
    End With
    ActiveChart.ChartArea.Select
    ActiveChart.Axes(xlCategory).Select
    With ActiveChart.Axes(xlCategory)
        .BaseUnit = xlMonths
        .MajorUnit = 1
        .MajorUnitScale = xlMonths
        .MinorUnit = 1
        .MinorUnitScale = xlMonths
        .Crosses = xlAutomatic
        .AxisBetweenCategories = True
        .ReversePlotOrder = False
    End With
    With ActiveSheet.ChartObjects(1)
        .Left = Range("A1").Left
        .Top = Range("A1").Top
    End With
    ActiveChart.PlotArea.Select
    With Selection.Border
        .ColorIndex = 8
        .Weight = xlThin
        .LineStyle = xlContinuous
    End With
    Selection.Fill.OneColorGradient Style:=msoGradientHorizontal, Variant:=1, _
        Degree:=0.331364919508659
    With Selection
        .Fill.Visible = True
        .Fill.ForeColor.SchemeColor = 8
    End With
    ActiveChart.Axes(xlValue).Select
    ActiveChart.ChartArea.Select
    With ActiveChart
        .HasTitle = True
        .ChartTitle.Characters.Text = _
        "Répartition du nombre d'appels par centre de gestion"
        .Axes(xlCategory, xlPrimary).HasTitle = True
        .Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Mois"
        .Axes(xlValue, xlPrimary).HasTitle = True
        .Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Nbre d'appels"
    End With
    ActiveChart.HasLegend = True
    ActiveChart.Legend.Select
    Selection.Position = xlBottom

Le problème est qu'il crée bien le graphique, mais pas la mise en forme!
 
- Navigue sans publicité
- Accède à Cléa, notre assistante IA experte Excel... et pas que...
- Profite de fonctionnalités exclusives
Ton soutien permet à Excel Downloads de rester 100% gratuit et de continuer à rassembler les passionnés d'Excel.
Je deviens Supporter XLD

Discussions similaires

Réponses
1
Affichages
607
Réponses
0
Affichages
597
Réponses
0
Affichages
799
Réponses
4
Affichages
2 K
Retour