Chartspace UF Problem
06.09.2004 06:58:51
Dirk
Ich habe in einer Userform ein Chartspace und ein Spreadsheet erstellt. Leider schaffe ich es nicht, die Prozentangaben außerhalb des Kreisdiagramms per Führungslinie darzustellen! Wer kann helfen?
Schon jetzt allen vielen Dank!!
Viele Grüsse,
Dirk
Code:
Private Sub userform_initialize()
Dim rng As Range, c, cht, a As Integer
Dim irow As Integer, icol As Integer
Schalter = True
'Spreadsheet füllen
Set rng = Tabelle1.Range("a1:l122")
For icol = 1 To rng.Columns.Count
For irow = 1 To rng.Rows.Count
Spreadsheet1.Cells(irow, icol).Value = Tabelle1.Cells(irow, icol).Value
Next irow
Next icol
'Diagramm erstellen
ChartSpace1.Clear
Set c = ChartSpace1.Constants
Set cht = ChartSpace1.Charts.Add
ChartSpace1.DataSourceType = chDataSourceTypeSpreadsheet
ChartSpace1.DataSource = Spreadsheet1
ChartSpace1.Charts(0).SeriesCollection.Add
ChartSpace1.Charts(0).SeriesCollection(0).DataLabelsCollection.Add
ChartSpace1.Charts(0).SeriesCollection(0).DataLabelsCollection(0).HasPercentage = True
ChartSpace1.Charts(0).SeriesCollection(0).DataLabelsCollection(0).HasValue = False
ChartSpace1.Charts(0).SeriesCollection(0).DataLabelsCollection(0).Font.Bold = True
ChartSpace1.Charts(0).SeriesCollection(0).DataLabelsCollection(0).Font.Size = 14
ChartSpace1.Charts(0).SeriesCollection(0).SetData c.chDimSeriesNames, 0, "a2"
ChartSpace1.Charts(0).SeriesCollection(0).SetData c.chDimCategories, 0, "b2:d2"
ChartSpace1.Charts(0).SeriesCollection(0).SetData c.chDimValues, 0, "B3:d3"
ChartSpace1.Charts(0).SeriesCollection(0).Type = chChartTypePieExploded
ChartSpace1.Charts(0).HasLegend = True
ChartSpace1.Charts(0).HasTitle = True
ChartSpace1.Charts(0).Legend.Position = chLegendPositionBottom
End Sub