0
Ich versuche, ein Balkendiagramm zu erstellen, aber horizontal ausgerichtet zu haben. Bisher kann ich es nur vertikal mit dem folgenden Code machen. Ich habe graben herum und man Quellen zeigen nur die vertikale Ausrichtung. Gibt es einen Weg, um Ändern der Grafikausrichtung in Excel VBA
Sub test_tic_count_graph()
Dim chtTicCount As chart
Dim ticCountGraph As Worksheet
Set ticCountGraph = ActiveWorkbook.Sheets("ticCountGraph")
Set chtTicCount = ticCountGraph.Shapes.AddChart(xlColumnClustered).chart
With chtTicCount
.SetSourceData Source:=ticCountGraph.Range("A1:B9")
''Activating the xlValue so we can refer to x-y values.
.HasAxis(xlValue, xlPrimary) = True
.HasAxis(xlValue, xlSecondary) = True
.Legend.Font.Size = 10
'' Sets legend position 100 points from top.
.Legend.Top = 100
''Label the X - axis. Note it's xlCategory.
With .Axes(xlValue, xlPrimary)
.HasTitle = True
.AxisTitle.Text = "DEVICE"
.AxisTitle.Font.Size = 10
'' Modify tickmark labels font size.
.TickLabels.Font.Size = 10
End With
'' Label the Y - axis. Note it's xlValue.
With .Axes(xlCategory, xlPrimary)
.HasTitle = True
''.AxisTitle.Text = "CPU %"
.AxisTitle.Font.Size = 10
.TickLabels.Font.Size = 10
''.MaximumScale = 1
End With
End With
End Sub