Гость
Целевая тема:
Создать новую тему:
Автор:
Форумы / Microsoft Office [игнор отключен] [закрыт для гостей] / Как програмно добавить надписи / 4 сообщений из 4, страница 1 из 1
15.06.2006, 18:42:16
    #33794012
Shkel Eugene
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Как програмно добавить надписи
В Excel графику необходимо добавить надписи по оси X, значения добавил с помощью SeriesCollection. Надписи добавить не могу :(
...
Рейтинг: 0 / 0
15.06.2006, 19:29:15
    #33794098
White Owl
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Как програмно добавить надписи
Там же, в SeriesCollection есть под-коллекция DataLabels
...
Рейтинг: 0 / 0
16.06.2006, 11:34:27
    #33795034
Shkel Eugene
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Как програмно добавить надписи
код можно ?

вот что я делаю с данными

Worksheets("Report").ChartObjects(3).Activate

ActiveChart.ChartArea.ClearContents
data = Strings.Replace("K96:K101", " ", "")
labels = Strings.Replace("J96:J101", " ", "")

ActiveChart.SeriesCollection.Add Source:=Worksheets("Report").Range(data)

labels - это range для надписей
...
Рейтинг: 0 / 0
16.06.2006, 17:59:40
    #33796600
White Owl
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Как програмно добавить надписи
Если ничто другое не помогает, прочтите наконец инструкцию:
DataLabelRepresents the data label on a chart point or trendline. On a series, the DataLabel object is a member of the DataLabels collection. The DataLabels collection contains a DataLabel object for each point. For a series without definable points (such as an area series), the DataLabels collection contains a single DataLabel object.

Using the DataLabel Object

Use DataLabels(index), where index is the data-label index number, to return a single DataLabel object. The following example sets the number format for the fifth data label in series one in embedded chart one on worksheet one.

Код: plaintext
1.
Worksheets( 1 ).ChartObjects( 1 ).Chart _
    .SeriesCollection( 1 ).DataLabels( 5 ).NumberFormat = "0.000"
Use the DataLabel property to return the DataLabel object for a single point. The following example turns on the data label for the second point in series one on the chart sheet named "Chart1" and sets the data label text to "Saturday."

Код: plaintext
1.
2.
3.
4.
5.
With Charts("chart1")
    With .SeriesCollection( 1 ).Points( 2 )
        .HasDataLabel = True
        .DataLabel.Text = "Saturday"
    End With
End With
On a trendline, the DataLabel property returns the text shown with the trendline. This can be the equation, the R-squared value, or both (if both are showing). The following example sets the trendline text to show only the equation and then places the data label text in cell A1 on the worksheet named "Sheet1."

Код: plaintext
1.
2.
3.
4.
With Charts("chart1").SeriesCollection( 1 ).Trendlines( 1 )
    .DisplayRSquared = False
    .DisplayEquation = True
    Worksheets("sheet1").Range("a1").Value = .DataLabel.Text
End With
...
Рейтинг: 0 / 0
Форумы / Microsoft Office [игнор отключен] [закрыт для гостей] / Как програмно добавить надписи / 4 сообщений из 4, страница 1 из 1
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]