Visual Basic Reference
Microsoft Graph Visual Basic Reference

To learn how to use Help, press F1.

	Programming Language Summary An alphabetical listing of all programming language topics including methods, objects, and properties. Methods An alphabetical listing of methods. Objects An alphabetical listing of objects. Properties An alphabetical listing of properties.


Application Object Properties

Application Object        Methods

Application

ChartWizardDisplay Property

Creator

Name

Parent


Axes Object Properties

Axes Object        Methods

Application

Count

Creator

Parent


Axis Object Properties

Axis Object        Methods

Application

AxisBetweenCategories

AxisGroup

AxisTitle

Border

Creator

Crosses

CrossesAt

HasMajorGridlines

HasMinorGridlines

HasTitle

MajorGridlines

MajorTickMark

MajorUnit

MajorUnitIsAuto

MaximumScale

MaximumScaleIsAuto

MinimumScale

MinimumScaleIsAuto

MinorGridlines

MinorTickMark

MinorUnit

MinorUnitIsAuto

Parent

ReversePlotOrder

ScaleType

TickLabelPosition

TickLabels

TickLabelSpacing

TickMarkSpacing

Type


AxisTitle Object Properties

AxisTitle Object        Methods

Application

Border

Caption

Creator

Font

HorizontalAlignment

Interior

Left

Name

Orientation

Parent

Shadow

Text

Top

VerticalAlignment


Border Object Properties

Border Object        Methods

Application

Color

ColorIndex

Creator

LineStyle

Parent

Weight


Chart Object Properties

Chart Object        Methods

Application

Area3DGroup

AutoScaling

Bar3DGroup

ChartArea

ChartTitle

Column3DGroup

Creator

DepthPercent

DisplayBlanksAs

Elevation

Floor

GapDepth

HasAxis

HasLegend

HasTitle

HeightPercent

Legend

Line3DGroup

Parent

Perspective

Pie3DGroup

PlotArea

RightAngleAxes

Rotation

SubType

SurfaceGroup

Type

Walls

WallsAndGridlines2D


ChartArea Object Properties

ChartArea Object        Methods

Application

Border

Creator

Font

Height

Interior

Left

Name

Parent

Shadow

Top

Width


ChartGroup Object Properties

ChartGroup Object        Methods

Application

AxisGroup

Creator

DoughnutHoleSize

DownBars

DropLines

FirstSliceAngle

GapWidth

HasDropLines

HasHiLoLines

HasRadarAxisLabels

HasSeriesLines

HasUpDownBars

HiLoLines

Overlap

Parent

RadarAxisLabels

SeriesLines

SubType

Type

UpBars

VaryByCategories


ChartGroups Object Properties

ChartGroups Object        Methods

Application

Count

Creator

Parent


ChartTitle Object Properties

ChartTitle Object        Methods

Application

Border

Caption

Creator

Font

HorizontalAlignment

Interior

Left

Name

Orientation

Parent

Shadow

Text

Top

VerticalAlignment


DataLabel Object Properties

DataLabel Object        Methods

Application

AutoText

Border

Caption

Creator

Font

HorizontalAlignment

Interior

Left

Name

NumberFormat

Orientation

Parent

Shadow

ShowLegendKey

Text

Top

Type

VerticalAlignment


DataLabels Object Properties

DataLabels Object        Methods

Application

AutoText

Border

Caption

Count

Creator

Font

HorizontalAlignment

Interior

Left

Name

NumberFormat

Orientation

Parent

Shadow

ShowLegendKey

Text

Top

Type

VerticalAlignment


DownBars Object Properties

DownBars Object        Methods

Application

Border

Creator

Interior

Name

Parent


DropLines Object Properties

DropLines Object        Methods

Application

Border

Creator

Name

Parent


ErrorBars Object Properties

ErrorBars Object        Methods

Application

Border

Creator

EndStyle

Name

Parent


Floor Object Properties

Floor Object        Methods

Application

Border

Creator

Interior

Name

Parent


Font Object Properties

Font Object        Methods

Application

Background

Bold

Color

ColorIndex

Creator

FontStyle

Italic

Name

OutlineFont

Parent

Shadow

Size

Strikethrough

Subscript

Superscript

Underline


Gridlines Object Properties

Gridlines Object        Methods

Application

Border

Creator

Name

Parent


HiLoLines Object Properties

HiLoLines Object        Methods

Application

Border

Creator

Name

Parent


Interior Object Properties

Interior Object        Methods

Application

Color

ColorIndex

Creator

Parent

Pattern

PatternColor

PatternColorIndex


Legend Object Properties

Legend Object        Methods

Application

Border

Creator

Font

Height

Interior

Left

Name

Parent

Position

Shadow

Top

Width


LegendEntries Object Properties

LegendEntries Object        Methods

Application

Count

Creator

Parent


LegendEntry Object Properties

LegendEntry Object        Methods

Application

Creator

Font

Index

LegendKey

Parent


LegendKey Object Properties

LegendKey Object        Methods

Application

Border

Creator

Interior

InvertIfNegative

MarkerBackgroundColor

MarkerBackgroundColorIndex

MarkerForegroundColor

MarkerForegroundColorIndex

MarkerStyle

Parent

Smooth


PlotArea Object Properties

PlotArea Object        Methods

Application

Border

Creator

Height

Interior

Left

Name

Parent

Top

Width


Point Object Properties

Point Object        Methods

Application

Border

Creator

DataLabel

Explosion

HasDataLabel

Interior

InvertIfNegative

MarkerBackgroundColor

MarkerBackgroundColorIndex

MarkerForegroundColor

MarkerForegroundColorIndex

MarkerStyle

Parent

PictureType

PictureUnit


Points Object Properties

Points Object        Methods

Application

Count

Creator

Parent


Series Object Properties

Series Object        Methods

Application

AxisGroup

Border

Creator

ErrorBars

Explosion

HasDataLabels

HasErrorBars

Interior

InvertIfNegative

MarkerBackgroundColor

MarkerBackgroundColorIndex

MarkerForegroundColor

MarkerForegroundColorIndex

MarkerStyle

Parent

PictureType

PictureUnit

Smooth

Type


SeriesCollection Object Properties

SeriesCollection Object        Methods

Application

Count

Creator

Parent


SeriesLines Object Properties

SeriesLines Object        Methods

Application

Border

Creator

Name

Parent


TickLabels Object Properties

TickLabels Object        Methods

Application

Creator

Font

Name

NumberFormat

Orientation

Parent


Trendline Object Properties

Trendline Object        Methods

Application

Backward

Border

Creator

DataLabel

DisplayEquation

DisplayRSquared

Forward

Index

Intercept

InterceptIsAuto

Name

NameIsAuto

Order

Parent

Period

Type


Trendlines Object Properties

Trendlines Object        Methods

Application

Count

Creator

Parent


UpBars Object Properties

UpBars Object        Methods

Application

Border

Creator

Interior

Name

Parent


Walls Object Properties

Walls Object        Methods

Application

Border

Creator

Interior

Name

Parent


Application Object Methods

Application Object        Properties

Chart Method

SaveAsOldExcelFileFormat Method


Axes Object Methods

Axes Object        Properties

Item


Axis Object Methods

Axis Object        Properties

Delete


AxisTitle Object Methods

AxisTitle Object        Properties

Delete


Border Object Methods

Border Object        Properties

This object has no methods.


Chart Object Methods

Chart Object        Properties

ApplyDataLabels

AreaGroups

AutoFormat

Axes

BarGroups

ChartGroups

ColumnGroups

Delete

DoughnutGroups

LineGroups Method

OmitBackground Method

PieGroups

RadarGroups

SeriesCollection

XYGroups


ChartArea Object Methods

ChartArea Object        Properties

Clear

ClearContents

ClearFormats

Copy


ChartGroup Object Methods

ChartGroup Object        Properties

SeriesCollection


ChartGroups Object Methods

ChartGroups Object        Properties

Item


ChartTitle Object Methods

ChartTitle Object        Properties

Delete


DataLabel Object Methods

DataLabel Object        Properties

Delete


DataLabels Object Methods

DataLabels Object        Properties

Delete

Item


DownBars Object Methods

DownBars Object        Properties

Delete


DropLines Object Methods

DropLines Object        Properties

Delete


ErrorBars Object Methods

ErrorBars Object        Properties

Clear Formats

Delete


Floor Object Methods

Floor Object        Properties

ClearFormats


Font Object Methods

Font Object        Properties

This object has no methods.


Gridlines Object Methods

Gridlines Object        Properties

Delete


HiLoLines Object Methods

HiLoLines Object        Properties

Delete


Interior Object Methods

Interior Object        Properties

This object has no methods.


Legend Object Methods

Legend Object        Properties

Delete

LegendEntries


LegendEntries Object Methods

LegendEntries Object        Properties

Item


LegendEntry Object Methods

LegendEntry Object        Properties

Delete


LegendKey Object Methods

LegendKey Object        Properties

ClearFormats

Delete


PlotArea Object Methods

PlotArea Object        Properties

ClearFormats


Point Object Methods

Point Object        Properties

ApplyDataLabels

ClearFormats

Copy

Delete


Points Object Methods

Points Object        Properties

Item


Series Object Methods

Series Object        Properties

ApplyDataLabels

ClearFormats

Copy

DataLabels

Delete

ErrorBar

Points

Trendlines


SeriesCollection Object Methods

SeriesCollection Object        Properties

Item


SeriesLines Object Methods

SeriesLines Object        Properties

Delete


TickLabels Object Methods

TickLabels Object        Properties

Delete


Trendline Object Methods

Trendline Object        Properties

Clear Formats

Delete


Trendlines Object Methods

Trendlines Object        Properties

Add

Item


UpBars Object Methods

UpBars Object        Properties

Delete


Walls Object Methods

Walls Object        Properties

ClearFormats


Programming Language Summary


 Programming Language Summary

A

Application Object

Application Property

ApplyDataLabels Method

Area3DGroup Property

AreaGroups Method

AutoScaling Property

AutoText Property

Axes Method

Axes Object

Axis Object

AxisBetweenCategories Property

AxisGroup Property

AxisTitle Object

AxisTitle Property

B

Background Property

Backward Property

Bar3DGroup Property

BarGroups Method

Bold Property

Border Object

Border Property

C

Caption Property

Chart Object

ChartArea Object

ChartArea Property

ChartGroup Object

ChartGroups Method

ChartGroups Object

ChartTitle Object

ChartTitle Property

Clear Method

ClearContents Method

ClearFormats Method

Color Property

ColorIndex Property

Column3DGroup Property

ColumnGroups Method

Copy Method

Count Property

Creator Property

Crosses Property

CrossesAt Property

D

DataLabel Object

DataLabel Property

DataLabels Method

DataLabels Object

Delete Method

DepthPercent Property

DisplayBlanksAs Property

DisplayEquation Property

DisplayRSquared Property

DoughnutGroups Method

DoughnutHoleSize Property

DownBars Object

DownBars Property

DropLines Object

DropLines Property

E

Elevation Property

EndStyle Property

ErrorBar Method

ErrorBars Object

ErrorBars Property

Explosion Property

F

FirstSliceAngle Property

Floor Object

Floor Property

Font Object

Font Property

FontStyle Property

Forward Property

G

GapDepth Property

GapWidth Property

Gridlines Object

H

HasAxis Property

HasDataLabel Property

HasDataLabels Property

HasDropLines Property

HasErrorBars Property

HasHiLoLines Property

HasLegend Property

HasMajorGridlines Property

HasRadarAxisLabels Property

HasSeriesLines Property

HasTitle Property

HasUpDownBars Property

Height Property

HeightPercent Property

HiLoLines Object

HorizontalAlignment Property

I

Index Property

Intercept Property

InterceptIsAuto Property

Interior Object

Interior Property

InvertIfNegative Property

Italic Property

Item Method

J

K

L

Left Property

Legend Object

LegendEntries Method

LegendEntries Object

LegendEntry Object

LegendKey Object

LegendKey Property

Line3DGroup Property

LineGroups Method

LineStyle Property

M

MajorTickMark Property

MajorUnit Property

MajorUnitIsAuto Property

MarkerBackgroundColor Property

MarkerBackgroundColorIndex Property

MarkerForegroundColor Property

MarkerForegroundColorIndex Property

MarkerStyle Property

MaximumScale Property

MaximumScaleIsAuto Property

MinimumScale Property

MinimumScaleIsAuto Property

MinorTickMark Property

MinorUnit Property

MinorUnitIsAuto Property

N

Name Property

NameIsAuto Property

NumberFormat Property

O

Order Property

Orientation Property

OutlineFont Property

Overlap Property

P

Parent Property

Pattern Property

PatternColor Property

PatternColorIndex Property

Period Property

Perspective Property

PictureType Property

PictureUnit Property

Pie3DGroup Property

PieGroups Method

PlotArea Object

PlotArea Property

Point Object

Points Method

Points Object

Position Property

Q

R

RadarGroups Method

ReversePlotOrder Property

RightAngleAxes Property

Rotation Property

S

SaveAsOldFileFormat Method

ScaleType Property

Series Object

SeriesCollection Method

SeriesCollection Object

SeriesLines Object

Shadow Property

ShowLegendKey Property

Size Property

Smooth Property

Strikethrough Property

Subscript Property

SubType Property

Superscript Property

SurfaceGroup Property

T

Text Property

TickLabelPosition Property

TickLabels Object

TickLabels Property

TickLabelSpacing Property

TickMarkSpacing Property

Top Property

Trendline Object

Trendlines Method

Trendlines Object

U

Underline Property

UpBars Object

UpBars Property

V

VaryByCategories Property

VerticalAlignment Property

W

Walls Object

Walls Property

WallsAndGridlines2D Property

Weight Property

X

XYGroups Method

Y

Z


Methods


Methods

A

ApplyDataLabels Method

AreaGroups Method

Axes Method

B

BarGroups Method

C

Chart Method

ChartGroups Method

Clear Method

ClearContents Method

ClearFormats Method

ColumnGroups Method

Copy Method

D

DataLabels Method

Delete Method

DoughnutGroups Method

E

ErrorBar Method

F

G

H

I

Item Method

J

K

L

LegendEntries Method

LineGroups Method

M

N

O

OmitBackground Method

P

PieGroups Method

Points Method

Q

R

RadarGroups Method

S

SaveAsOldFileFormat Method

SeriesCollection Method

T

Trendlines Method

U

V

W

X

XYGroups Method

Y

Z


 Properties


 Properties

A

Application Property

Area3DGroup Property

AutoScaling Property

AutoText Property

AxisBetweenCategories Property

AxisGroup Property

AxisTitle Property

B

Background Property

Backward Property

Bar3DGroup Property

Bold Property

Border Property

C

Caption Property

ChartArea Property

ChartTitle Property

ChartWizardDisplay Property

Color Property

ColorIndex Property

Column3DGroup Property

Count Property

Creator Property

Crosses Property

CrossesAt Property

D

DataLabel Property

DepthPercent Property

DisplayBlanksAs Property

DisplayEquation Property

DisplayRSquared Property

DoughnutHoleSize Property

DownBars Property

DropLines Property

E

Elevation Property

EndStyle Property

ErrorBars Property

Explosion Property

F

FirstSliceAngle Property

Floor Property

Font Property

FontStyle Property

Forward Property

G

GapDepth Property

GapWidth Property

H

HasAxis Property

HasDataLabel Property

HasDataLabels Property

HasDropLines Property

HasErrorBars Property

HasHiLoLines Property

HasHiLoLines Property

HasLegend Property

HasLegend Property

HasMajorGridlines Property

HasMajorGridlines Property

HasMinorGridlines Property

HasMinorGridlines Property

HasRadarAxisLabels Property

HasRadarAxisLabels Property

HasSeriesLines Property

HasSeriesLines Property

HasTitle Property

HasUpDownBars Property

Height Property

HeightPercent Property

HorizontalAlignment Property

I

Index Property

Intercept Property

InterceptIsAuto Property

Interior Property

InvertIfNegative Property

Italic Property

J

K

L

Left Property

LegendKey Property

Line3DGroup Property

LineStyle Property

M

MajorTickMark Property

MajorUnit Property

MajorUnitIsAuto Property

MarkerBackgroundColor Property

MarkerBackgroundColorIndex Property

MarkerForegroundColor Property

MarkerForegroundColorIndex Property

MarkerStyle Property

MaximumScale Property

MaximumScaleIsAuto Property

MinimumScale Property

MinimumScaleIsAuto Property

MinorTickMark Property

MinorUnit Property

MinorUnitIsAuto Property

N

Name Property

NameIsAuto Property

NumberFormat Property

O

Order Property

Orientation Property

OutlineFont Property

Overlap Property

P

Parent Property

Pattern Property

PatternColor Property

PatternColorIndex Property

Period Property

Perspective Property

PictureType Property

PictureUnit Property

Pie3DGroup Property

PlotArea Property

Position Property

Q

R

ReversePlotOrder Property

RightAngleAxes Property

Rotation Property

S

ScaleType Property

Shadow Property

ShowLegendKey Property

Size Property

Smooth Property

Strikethrough Property

Subscript Property

SubType Property

SubType Property

Superscript Property

SurfaceGroup Property

T

Text Property

TickLabelPosition Property

TickLabels Property

TickLabelSpacing Property

TickMarkSpacing Property

Top Property

U

Underline Property

UpBars Property

V

VaryByCategories Property

VerticalAlignment Property

W

Walls Property

WallsAndGridlines2D Property

Weight Property

X

Y

Z


 Objects


 Objects

A

Application Object

Axes Object

Axis Object

AxisTitle Object

B

Border Object

C

Chart Object

ChartArea Object

ChartGroup Object

ChartGroups Object

ChartTitle Object

D

DataLabel Object

DataLabels Object

DownBars Object

DropLines Object

E

ErrorBars Object

F

Floor Object

Font Object

G

Gridlines Object

H

HiLoLines Object

I

Interior Object

J

K

L

Legend Object

LegendEntries Object

LegendEntry Object

LegendKey Object

M

N

O

P

PlotArea Object

Point Object

Points Object

Q

R

S

Series Object

SeriesCollection Object

SeriesLines Object

T

TickLabels Object

Trendline Object

Trendlines Object

U

UpBars Object

V

W

Walls Object

X

Y

Z


Add Method (Trendlines Collection)

See Also	Example

Applies To

Trendlines

Description

Creates a new Trendline.

Syntax

object.Add(type, order, period, forward, backward, intercept, displayEquation, displayRSquared, name)

Elements

The Add method has the following object qualifier and named arguments:

object

Required. The Trendlines object.

type

Optional. Specifies the trendline type (one of xlLinear, xlLogarithmic, xlExponential, xlPolynomial, xlMovingAvg, or xlPower). If omitted, the default is xlLinear.

order

Required if type is xlPolynomial. Specifies the trendline order. Must be an integer from two to six, inclusive.

period

Required if type is xlMovingAvg. Specifies the trendline period. Must be an integer greater than one and less than the number of data points in the series you are adding a trendline to.

forward

Optional. Sets the number of periods (or units on a scatter chart) that the trendline extends forward.

backward

Optional. Sets the number of periods (or units on a scatter chart) that the trendline extends backward.

intercept

Optional. Sets the trendline intercept. If omitted, the intercept is automatically set by the regression.

displayEquation

Optional. True if the equation of the trendline is displayed on the chart (in the same data label as the R-squared value).

displayRSquared

Optional. True if the R-squared value of the trendline is displayed on the chart (in the same data label as the equation).

name

Optional. Specifies the name of the trendline as text. If this argument is omitted, an automatically generated name is used.


See Also

Backward Property

DisplayEquation Property

DisplayRSquared Property

Forward Property

Intercept Property

Order Property

Period Property


Add Method (Trendlines Collection) Example

This example creates a new linear trendline.

Set newTrendline = _

myChart.SeriesCollection(1).Trendlines.Add


Application Property

See Also	Example

Applies To

All objects

Description

Returns the Application that created this object. Read-only.

Syntax

object.Application

Elements

object

Required. The object to which this property applies.

Remarks

The value of this property is "Microsoft Graph" if the object was created by Microsoft Graph.


See Also

Creator Property


Application Property Example

This example runs a conditional block if an object was created by Microsoft Graph.

If myChart.Application.Name = Microsoft Graph Then

MsgBox This is Microsoft Graph

End If


ApplyDataLabels Method

See Also	Example

Applies To

Chart, Point, Series

Description

Applies data labels to the point, the series, or to all series on the chart.

Syntax

object.ApplyDataLabels(type, legendKey)

Elements

The ApplyDataLabels method has the following object qualifier and named arguments:

object

Required. The Chart, Point, or Series object.

type

Optional.The type of data label, as shown in the following list.

Value	Meaning

xlNone	No data labels.

xlShowValue	Value for the point (assumed if this argument is not specified).

xlShowPercent	Percentage of the total. Only available for pie and doughnut charts.

xlShowLabel	Category for the point.

xlShowLabelAndPercent	Percentage of the total and category for the point. Only available for pie and doughnut charts.

legendKey

Optional. If True, Microsoft Graph shows the legend key next to the point.


See Also

DataLabel Property

HasDataLabel Property

HasDataLabels Property


ApplyDataLabels Method Example

This example applies category labels to the first series.

myChart.SeriesCollection(1).ApplyDataLabels type:=xlShowLabel


Area3DGroup Property

See Also	Example

Applies To

Chart

Description

Returns the area ChartGroup on a 3-D chart.

Syntax

object.Area3DGroup

Elements

object

Required. The Chart object.


See Also

AreaGroups Method


Area3DGroup Property Example

This example sets the subtype for the 3-D area chart group.

myChart.Area3DGroup.SubType = 3


AreaGroups Method

See Also	Example

Applies To

Chart

Description

On a 2-D chart, returns a single area chart group (a ChartGroup object, Syntax 1), or a collection of the area chart groups (a ChartGroups collection, Syntax 2).

Syntax 1

object.AreaGroups(index)

Syntax 2

object.AreaGroups

Elements

The AreaGroups method has the following object qualifier and named arguments:

object

Required. The Chart object.

index

Required for Syntax 1. Specifies the chart group.


See Also

Area3DGroup Property


AreaGroups Method Example

This example sets the subtype for the first area chart group.

myChart.AreaGroups(1).SubType = 3


AutoFormat Method (Chart object)

Examples

Applies To

Chart

Description

Applies a built-in or custom autoformat to the specified chart.

Syntax

object.AutoFormat(gallery, format)

Elements

The AutoFormat method has the following object qualifier and named arguments:

object

Required. The Chart object.

gallery

Required. Specifies the built-in gallery. Can be one of xl3DArea, xl3DBar, xl3DColumn, xl3DLine, xl3DPie, xl3DSurface, xlArea, xlBar, xlColumn, xlCombination, xlCustom, xlDoughnut, xlLine, xlPie, xlRadar, or xlXYScatter.

format

Optional. Specifies the option number for the built-in autoformats or a string containing the name of the custom autoformat if gallery is xlCustom.


AutoFormat Method Examples

This example applies the third radar autoformat.

myChart.AutoFormat xlRadar, 3

This example applies the "Monthly Sales" custom autoformat.

myChart.AutoFormat xlCustom, "Monthly Sales"


AutoScaling Property

Example

Applies To

Chart

Description

If True, Microsoft Graph scales a 3-D chart so that it is closer in size to the equivalent 2-D chart. The RightAngleAxes property must be True. Read-write.

Syntax

object.AutoScaling

Elements

object

Required. The Chart object.


AutoScaling Property Example

This example scales the 3-D chart.

With myChart

.RightAngleAxes = True

.AutoScaling = True

End With


AutoText Property

Example

Applies To

DataLabel, DataLabels

Description

True if the object automatically generates appropriate text based on context. Read-write.

Syntax

object.AutoText

Elements

object

Required. The DataLabel or DataLabels object.


AutoText Property Example

This example sets the data labels on series one to automatically generate appropriate text.

myChart.SeriesCollection(1).DataLabels.AutoText = True


Axes Method

Example

Applies To

Chart

Description

Returns a single axis (an Axis object, Syntax 1) or a collection of the axes on the chart (an Axes object, Syntax 2). Read-only.

Syntax 1

object.Axes(type, axisGroup)

Syntax 2

object.Axes

Elements

The Axes method has the following object qualifier and named arguments:

object

Required. The Chart object.

type

Required for Syntax 1. Specifies the axis to return. Can be one of xlValue, xlCategory, or xlSeries (xlSeries is only valid for 3-D charts).

axisGroup

Optional. Specifies the axis group (either xlPrimary or xlSecondary). If this argument is omitted, the primary group is used. 3-D charts have only one axis group.


Axes Method Example

This example turns on major gridlines for the category (x) axis.

myChart.Axes(xlCategory).HasMajorGridlines = True


AxisBetweenCategories Property

Example

Applies To

Axis

Description

True if the value axis crosses the category (x) axis between categories.

Syntax

object.AxisBetweenCategories

Elements

object

Required. The Axis object.

Remarks

This property only applies to category axes, and does not apply to 3-D charts.


AxisBetweenCategories Property Example

This example causes the value axis to cross the category (x) axis between categories.

myChart.Axes(xlCategory).AxisBetweenCategories = True


AxisGroup Property

Example

Applies To

Axis, ChartGroup, Series

Description

Returns the group (either xlPrimary or xlSecondary) for the specified axis, chart group, or series. Read-write for Series; read-only for Axis and ChartGroup.

Syntax

object.AxisGroup

Elements

object

Required. The Axis, ChartGroup, or Series object.

Remarks

For 3-D charts, only xlPrimary is valid.


AxisGroup Property Example

This example deletes the value axis if it is in the secondary group.

With myChart.Axes(xlValue)

If .AxisGroup = xlSecondary Then .Delete

End With


AxisTitle Property

See Also	Example

Applies To

Axis

Description

Returns the AxisTitle for the specified axis. Read-only.

Syntax

object.AxisTitle

Elements

object

Required. The Axis object.

Remarks

Setting AxisTitle.Caption to any string, even a blank string, forces the HasTitle property for that axis to True.


See Also

ChartTitle Property

HasTitle Property


AxisTitle Property Example

This example sets the category axis title text.

With myChart.Axes(xlCategory).AxisTitle

.Caption = "Category Axis"

.Font.Italic = True

.Font.Size = 17

End With


Background Property

Example

Applies To

Font

Description

Returns or sets the text background type (can be one of xlAutomatic, xlOpaque, or xlTransparent). This property is only used for text on charts. Read-write.

Syntax

object.Background

Elements

object

Required. The Font object.


Background Property Example

This example sets the font size and background type of the title on chart one.

With myChart.ChartTitle.Font

.Size = 10

.Background = xlTransparent

End With


Backward Property

See Also	Example

Applies To

Trendline

Description

Returns or sets the number of periods (or units on a scatter chart) that the trendline extends backward. Read-write.

Syntax

object.Backward

Elements

object

Required. The Trendline object.


See Also

Add Method

Forward Property


Backward Property Example

This example sets the number of units the trendline extends forward and backward.

With myChart.SeriesCollection(1).Trendlines(1)

.Forward = 5

.Backward = .5

End With


Bar3DGroup Property

See Also	Example

Applies To

Chart

Description

Returns the bar ChartGroup on a 3-D chart.

Syntax

object.Bar3DGroup

Elements

object

Required. The Chart object.


See Also

BarGroups Method


Bar3DGroup Property Example

This example sets the subtype for the 3-D bar chart group.

myChart.Bar3DGroup.SubType = 3


BarGroups Method

See Also	Example

Applies To

Chart

Description

On a 2-D chart, returns a single bar chart group (a ChartGroup object, Syntax 1), or a collection of the bar chart groups (a ChartGroups collection, Syntax 2).

Syntax 1

object.BarGroups(index)

Syntax 2

object.BarGroups

Elements

The BarGroups method has the following object qualifier and named arguments:

object

Required. The Chart object.

index

Required for Syntax 1. Specifies the chart group.


See Also

Bar3DGroup Property


BarGroups Method Example

This example sets the subtype for the first bar chart group.

myChart.BarGroups(1).SubType = 3


Bold Property

Example

Applies To

Font

Description

True if the font is bold. Read-write.

Syntax

object.Bold

Elements

object

Required. The Font object.


Bold Property Example

This example sets the font to bold for the chart title.

MyChart.ChartTitle.Font.Bold = True


Border Property

Example

Applies To

Axis, AxisTitle, ChartArea, ChartTitle, DataLabel, DataLabels, DownBars, DropLines, ErrorBars, Floor, Gridlines, HiLoLines, Legend, LegendKey, PlotArea, Point, Series, SeriesLines, Trendline, UpBars, Walls

Description

Returns or sets the Border of the object. Read-write.

Syntax

object.Border

Elements

object

Required. The object to which this property applies.


Border Property Example

This example sets the color of the chart area border.

myChart.ChartArea.Border.Color = RGB(255, 0, 0)


Caption Property

See Also	Examples

Applies To

AxisTitle, ChartTitle, DataLabel, DataLabels

Description

The Caption property has several different meanings, depending on the object type to which it is applied. The Caption property is read-write, except as noted in the following list.

Object type	Meaning

AxisTitle	The axis title text.

ChartTitle	The chart title text.

DataLabel	The data label text.

Syntax

object.Caption

Elements

object

Required. The object to which this property applies.


See Also

Text Property


Caption Property Examples

This example adds the title "Annual Salary Figures" to a chart.

myChart.HasTitle = True

myChart.ChartTitle.Caption = "Annual Salary Figures"


ChartArea Property

Example

Applies To

Chart

Description

Returns the complete ChartArea for the chart. Read-only.

Syntax

object.ChartArea

Elements

object

Required. The Chart object.


ChartArea Property Example

This example sets the chart area color to red.

myChart.ChartArea.Interior.Color = RGB(255,0,0)


ChartGroups Method

Example

Applies To

Chart

Description

Returns a single chart group (a ChartGroup object, Syntax 1) or a collection of all the chart groups in the chart (a ChartGroups object, Syntax 2). Every type of group is included in the returned collection.

Syntax 1

object.ChartGroups(index)

Syntax 2

object.ChartGroups

Elements

The ChartGroups method has the following object qualifier and named arguments:

object

Required. The Chart object.

index

Required for Syntax 1. The number of the chart group.


ChartGroups Method Example

This example makes chart group one an area chart.

myChart.ChartGroups(1).Type = xlArea


ChartTitle Property

See Also	Example

Applies To

Chart

Description

Returns the ChartTitle for the specified chart. Read-only.

Syntax

object.ChartTitle

Elements

object

Required. The Chart object.


See Also

AxisTitle Property

HasTitle Property


ChartTitle Property Example

This example sets the active chart title text.

With myChart

.HasTitle = True

.ChartTitle.Text = "February Sales"

.ChartTitle.Font.Bold = True

.ChartTitle.Font.Size = 18

End With


Clear Method

See Also	Example

Applies To

ChartArea

Description

Clears the entire chart area.

Syntax

object.Clear

Elements

object

Required. The ChartArea object.


See Also

ClearFormats Method

ClearContents Method


Clear Method Example

This example clears the entire chart area.

myChart.ChartArea.Clear


ClearContents Method

Example

Applies To

ChartArea

Description

Clears the data from a chart but leaves the formatting.

Syntax

object.ClearContents

Elements

object

Required. The Chart object.


ClearContents Method Example

This example clears the data from the chart.

myChart.ChartArea.ClearContents


ClearFormats Method

See Also	Example

Applies To

ChartArea, ErrorBars, Floor, LegendKey, PlotArea, Point, Series, Trendline, Walls

Description

Clears the formatting of the object.

Syntax

object.ClearFormats

Elements

object

Required. The object to which this method applies.


See Also

Clear Method

ClearContents Method


ClearFormats Method Example

This example clears all formatting from the chart.

myChart.ChartArea.ClearFormats


Color Property

Example

Applies To

Border, Font, Interior

Description

Returns or sets the primary color of the object, as shown in the following table. The color is a long integer, created with the RGB function. Read-write.

Object	Color

Border	The color of the border.

Font	The color of the font.

Interior	The cell shading color or drawing object fill color.

Syntax

object.Color

Elements

object

Required. The object to which this property applies.

Remark

If the color is Automatic, the Color property returns the automatic color as an RGB value (a long integer). Use the ColorIndex property to determine if the color is Automatic.


Color Property Example

This example sets the color of the tick labels on the value axis.

myChart.Axes(xlValue).TickLabels.Font.Color = RGB(0, 255, 0)


ColorIndex Property

See Also	Example

Applies To

Border, Font, Interior

Description

Returns or sets the color of the border, font, or interior, as shown in the following table. The color is specified as an index value into the current color palette, or the special constant xlAutomatic to use the automatic fill style. Read-write.

Object	ColorIndex

Border	Color of the border.

Font	Color of the font. Specify xlAutomatic to use the automatic color.

Interior	Color of the interior fill. Set this property to xlNone to specify no fill. Set this property to xlAutomatic to specify the automatic fill (for drawing objects).

Syntax

object.ColorIndex

Elements

object

Required. The object to which this property applies.

Remarks

This property specifies a color as an index into the workbook color palette. You can use the Colors property to return the current color palette.


See Also

Color Property

PatternColor Property


ColorIndex Property Example

This example sets the color of the chart area border  to the tenth color in the palette.

myChart.ChartArea.Border.ColorIndex = 10


Column3DGroup Property

See Also	Example

Applies To

Chart

Description

Returns the column ChartGroup on a 3-D chart.

Syntax

object.Column3DGroup

Elements

object

Required. The Chart object.


See Also

ColumnGroups Method


Column3DGroup Property Example

This example sets the subtype for the 3-D column chart group.

myChart.Column3DGroup.SubType = 4


ColumnGroups Method

See Also	Example

Applies To

Chart

Description

On a 2-D chart, returns a single column chart group (a ChartGroup object, Syntax 1), or a collection of the column chart groups (a ChartGroups collection, Syntax 2).

Syntax 1

object.ColumnGroups(index)

Syntax 2

object.ColumnGroups

Elements

The ColumnGroups method has the following object qualifier and named arguments:

object

Required. The Chart object.

index

Required for Syntax 1. Specifies the chart group.


See Also

Column3DGroup Property


ColumnGroups Method Example

This example sets the subtype for the first column chart group.

myChart.ColumnGroups(1).SubType = 3


Copy Method

Applies To

ChartArea, Point, Series

Description

Copies a picture of the point or series to the Clipboard.

Syntax

object.Copy

Elements

The Copy method has the following object qualifier and named arguments:

object

Required. The object to which this method applies.


Count Property

Example

Applies To

All collections

Description

Returns the number of items in the collection. Read-only.

Syntax

object.Count

Elements

object

Required. The object to which this property applies.


Count Property Example

This example displays the number of chart groups in the chart.

MsgBox "The chart contains " & myChart.ChartGroups.Count & " chart groups."


Creator Property

See Also	Example

Applies To

All objects

Description

Returns the application that created this object, as a 32-bit integer. If the object was created by Microsoft Graph, this property returns the string MSGR, which is the hexadecimal number 4D534752. Read-only.

Syntax

object.Creator

Elements

object

Required. The object to which this property applies.

Remark

The Creator property is designed to be used in Microsoft Graph for the Apple Macintosh, where each application has a four-character creator code. For example, Microsoft Graph has the creator code MSGR.


See Also

Application Property


Creator Property Example

This example displays a message about the creator of the chart object. .

If myChart.Creator = &h4D534752 Then

MsgBox "This is a Microsoft Graph object"

Else

MsgBox "This is not a Microsoft Graph object"

End If


Crosses Property

See Also	Example

Applies To

Axis

Description

Returns or sets the point on the specified axis where the other axis crosses, as shown in the following list. Read-write.

Value	Meaning

xlAutomatic	Microsoft Graph sets the axis crossing.

xlMinimum	The axis crosses at the minimum value.

xlMaximum	The axis crosses at the maximum value.

xlCustom	The CrossesAt property specifies the crossing point.

Syntax

object.Crosses

Elements

object

Required. The Axis object.

Remarks

This property is not available for 3-D charts or radar charts.

This property can be used for both category and value axes. On the category axis, xlMinimum sets the value axis to cross at the first category, and xlMaximum sets the value axis to cross at the last category.

xlMinimum and xlMaximum can have different meanings, depending on the axis.


See Also

CrossesAt property


Crosses Property Example

This example sets the value axis to cross the category (x) axis at the maximum x value.

myChart.Axes(xlCategory).Crosses = xlMaximum


CrossesAt Property

See Also	Example

Applies To

Axis

Description

Returns or sets the point on the value axis where the category (x) axis crosses. Applies only to the value axis. Read-write.

Syntax

object.CrossesAt

Elements

object

Required. The Axis object.

Remarks

Setting this property causes the Crosses property to change to xlCustom.

This property is not available for 3-D charts or radar charts.


See Also

Crosses property


CrossesAt Property Example

This example sets the category (x) axis to cross the value axis at value 3.

With myChart.Axes(xlValue)

.Crosses = xlCustom

.CrossesAt = 3

End With


DataLabel Property

See Also	Example

Applies To

Point, Trendline

Description

Returns the DataLabel associated with the point or trendline. Read-only.

Syntax

object.DataLabel

Elements

object

Required. The Point or Trendline object.


See Also

ApplyDataLabels Method

HasDataLabel Property


DataLabel Property Example

This example turns on the data label for point seven on series three, and then sets the datalabel color.

With myChart.SeriesCollection(3).Points(7)

.HasDataLabel = True

.ApplyDataLabels type:=xlShowValue

.DataLabel.Font.Color = RBG(0, 0 ,255)

End With


DataLabels Method

See Also	Example

 Applies To

Series

Description

Returns a single data label (a DataLabel object, Syntax 1) or a collection of all data labels for the series (a DataLabels collection, Syntax 2).

Syntax 1

object.DataLabels(index)

Syntax 2

object.DataLabels

Elements

The DataLabels method has the following object qualifier and named arguments:

object

Required. The Series object.

index

Required for Syntax 1. The number of the data label.

Remarks

If the series has the Show Value option on for the data labels, the returned collection can contain up to one label for each point. Data labels can be turned on or off for individual points in the series.

If the series is on an area chart and has the Show Label option on for the data labels, the returned collection contains only a single label, which is the label for the area series.


See Also

DataLabel Property


DataLabels Method Example

This example sets the data labels for series one to show their value and key.

With myChart.SeriesCollection(1).DataLabels

.ShowLegendKey = True

.Type = xlShowValue

End With


Delete Method

Example

Applies To

Axis, AxisTitle, ChartTitle, DataLabel, DataLabels, DownBars, DropLines, ErrorBars, Gridlines, HiLoLines, Legend, LegendEntry, LegendKey, Point, Series, SeriesLines, TickLabels, Trendline, UpBars

Description

Deletes the object.

Syntax

object.Delete

Elements

object

Required. The object to which this method applies.

Remarks

Deleting a Point or LegendKey deletes the entire series.


Delete Method Example

This example deletes the chart title.

myChart.ChartTitle.Delete


DepthPercent Property

See Also	Example

Applies To

Chart

Description

Returns or sets the depth of a 3-D chart as a percentage of the chart width (between 20 and 2000 percent). Read-write.

Syntax

object.DepthPercent

Elements

object

Required. The Chart object.


See Also

HeightPercent Property


DepthPercent Property Example

This example sets the chart depth to 50 percent of its width.

myChart.DepthPercent = 50


DisplayBlanksAs Property

Example

Applies To

Chart

Description

Returns or sets how blank cells are plotted on a chart (one of xlNotPlotted, xlInterpolated, or xlZero). Read-write.

Syntax

object.DisplayBlanksAs

Elements

object

Required. The Chart object.


DisplayBlanksAs Property Example

This example causes Microsoft Graph not to plot blank cells.

myChart.DisplayBlanksAs = xlNotPlotted


DisplayEquation Property

See Also	Example

Applies To

Trendline

Description

True if the equation for the trendline is displayed on the chart (in the same data label as the R-squared value). Setting this property to True automatically turns on data labels. Read-write.

Syntax

object.DisplayEquation

Elements

object

Required. The Trendline object.


See Also

Add Method

DisplayRSquared Property


DisplayEquation Property Example

This example displays the R-squared value and equation for trendline one.

With myChart.SeriesCollection(1).Trendlines(1)

.DisplayRSquared = True

.DisplayEquation = True

End With


DisplayRSquared Property

See Also	Example

Applies To

Trendline

Description

True if the R-squared value of the trendline is displayed on the chart (in the same data label as the equation). Setting this property to True automatically turns on data labels. Read-write.

Syntax

object.DisplayRSquared

Elements

object

Required. The Trendline object.


See Also

Add Method

DisplayEquation Property


DisplayRSquared Property Example

This example displays the R-squared value and equation for trendline one.

With myChart.SeriesCollection(1).Trendlines(1)

.DisplayRSquared = True

.DisplayEquation = True

End With


DoughnutGroups Method

Example

Applies To

Chart

Description

Returns a single doughnut chart group (a ChartGroup object, Syntax 1), or a collection of the doughnut chart groups (a ChartGroups collection, Syntax 2).

Syntax 1

object.DoughnutGroups(index)

Syntax 2

object.DoughnutGroups

Elements

The DoughnutGroups method has the following object qualifier and named arguments:

object

Required. The Chart object.

index

Required for Syntax 1. Specifies the chart group.


DoughnutGroups Method Example

This example sets the starting angle for the first doughnut group.

myChart.DoughnutGroups(1).FirstSliceAngle = 45


DoughnutHoleSize Property

Example

Applies To

ChartGroup

Description

Returns or sets the size of the hole in a doughnut chart group. The hole size is expressed as a percentage of the chart size from 10 to 90 percent. Read-write.

Syntax

object.DoughnutHoleSize

Elements

object

Required. The ChartGroup object.


DoughnutHoleSize Property Example

This example sets the hole size for doughnut chart group one.

myChart.DoughnutGroups(1).DoughnutHoleSize = 10


DownBars Property

See Also	Example

Applies To

ChartGroup

Description

Returns the DownBars on a line chart. Applies only to line charts. Read-only.

Syntax

object.DownBar

Elements

object

Required. The ChartGroup object.


See Also

HasUpDownBars Property

UpBars Property


DownBars Property Example

This example turns on up and down bars for the first chart group, and then sets their colors.

With myChart.ChartGroups(1)

.HasUpDownBars = True

.DownBars.Interior.Color = RGB(255, 0, 0)

.UpBars.Interior.Color = RGB(0, 0, 255)

End With


DropLines Property

See Also	Example

Applies To

ChartGroup

Description

Returns or sets the DropLines for a series on a line or area chart. Applies only to line or area charts. Read-write.

Syntax

object.DropLines

Elements

object

Required. The ChartGroup object.


See Also

HasDropLines Property


DropLines Property Example

This example turns on drop lines for the first chart group, and then sets their line style, weight, and color.

With myChart.ChartGroups(1)

.HasDropLines = True

With .DropLines.Border

.LineStyle = xlDash

.Weight = xlMedium

.Color = RGB(255, 0, 0)

End With

End With


Elevation Property

See Also	Example

Applies To

Chart

Description

Returns or sets the elevation of the 3-D chart view, in degrees. Read-write.

Syntax

object.Elevation

Elements

object

Required. The Chart object.

Remarks

The chart elevation is the height at which you view the chart, in degrees. The default is 15 for most chart types. The value of this property must be between -90 and 90, except for 3-D bar charts, where it must be between 0 and 44.


See Also

Perspective Property

Rotation Property


Elevation Property Example

This example sets the chart elevation to 34 degrees.

myChart.Elevation = 34


EndStyle Property

Example

Applies To

ErrorBars

Description

Returns or sets the end style for the error bars (either xlCap or xlNoCap). Read-write.

Syntax

object.EndStyle

Elements

object

Required. The ErrorBars object.


EndStyle Property Example

This example sets the end style for the error bars on series one.

myChart.SeriesCollection(1).ErrorBars.EndStyle = xlCap


ErrorBar Method

See Also	Example

Applies To

Series

Description

Applies error bars to the series.

Syntax

object.ErrorBar(direction, include, type, amount, minusValues)

Elements

The ErrorBar method has the following object qualifier and named arguments:

object

Required. The Series object.

direction

Optional. Specifies the error bar direction (can be xlX or xlY; X is only available for scatter charts). If omitted, error bars are applied in the Y direction.

include

Optional. Specifies the error bar parts to include (one of xlPlusValues, xlMinusValues, xlNone, or xlBoth). If omitted, both error bars are included.

type

Optional. Specifies the error bar type (one of xlFixedValue, xlPercent, xlStDev, xlStError, or xlCustom).

amount

Optional. The error amount. Used for only the positive error amount when type = xlCustom.

minusValues

Optional. The negative error amount when type = xlCustom.


See Also

ErrorBars Property

HasErrorBars Property


ErrorBar Method Example

This example applies standard error bars in the Y direction, including both positive and negative.

myChart.SeriesCollection(1).ErrorBar _

direction:=xlY, include:=xlBoth, type:=xlStError


ErrorBars Property

See Also	Example

Applies To

Series

Description

Returns the ErrorBars for the series. Read-only.

Syntax

object.ErrorBars

Elements

object

Required. The Series object.


See Also

ErrorBar Method

HasErrorBars Property


ErrorBars Property Example

This example sets the error bar color.

With myChart.SeriesCollection(1)

.HasErrorBars = True

.ErrorBars.Border.Color = RGB(0, 255, 0)

End With


Explosion Property

Example

Applies To

Point, Series

Description

Returns or sets the percentage of pie-chart or doughnut-chart slice explosion. Zero is no explosion (the tip of the slice is in the center of the pie). Read-write.

Syntax

object.Explosion

Elements

object

Required. The Point or Series object.


Explosion Property Example

This example sets the explosion value for point five on the active chart.

myChart.SeriesCollection(1).Points(5).Explosion = 50


FirstSliceAngle Property

Example

Applies To

ChartGroup

Description

Returns or sets the angle of the first pie or doughnut slice for a pie, 3-D pie, or doughnut chart, in degrees clockwise from vertical. Applies only to pie, 3-D pie, and doughnut charts. Read-write.

Syntax

object.FirstSliceAngle

Elements

object

Required. The ChartGroup object.


FirstSliceAngle Property Example

This example sets the angle for the first slice in the first chart group.

myChart.ChartGroups(1).FirstSliceAngle = 15


Floor Property

Example

Applies To

Chart

Description

Returns the Floor of the 3-D chart. Read-only.

Syntax

object.Floor

Elements

object

Required. The Chart object.


Floor Property Example

This example sets the chart floor color.

myChart.Floor.Interior.Color = RGB(255, 0, 0)


Font Property

See Also	Example

Applies To

AxisTitle, ChartArea, ChartTitle, DataLabel, DataLabels, Legend, LegendEntry, TickLabels

Description

Returns or sets the Font of the object. Read-write.

Syntax

object.Font

Elements

object

Required. The object to which this property applies.


See Also

Font object


Font Property Example

This example sets the font in the chart title  to 14-point bold italic.

With ChartTitle.Font

.Size = 14

.Bold = True

.Italic = True

End With


FontStyle Property

See Also	Example

Applies To

Font

Description

Returns or sets the font style (as a string). Read-write.

Syntax

object.FontStyle

Elements

object

Required. The Font object.

Remarks

Changing this property may affect other Font properties (such as Bold and Italic).

Unlike most properties, this property is always in the language of the system because the system determines which fonts are available. So instead of being able to use "Bold" from an English macro running on Spanish Windows, you must use "Negrita." Use the separate Font object properties to work around this restriction.


See Also

Font Object

Background Property

Bold Property

Color Property

ColorIndex Property

Italic Property

Name Property

OutlineFont Property

Shadow Property

Size Property

Strikethrough Property

Subscript Property

Superscript Property

Underline Property


FontStyle Property Example

This example sets the font style for the chart title.

myChart.ChartTitle.Font.FontStyle = "Bold Italic"


Forward Property

See Also	Example

Applies To

Trendline

Description

Returns or sets the number of periods (or units on a scatter chart) that the trendline extends forward. Read-write.

Syntax

object.Forward

Elements

object

Required. The Trendline object.


See Also

Add Method

Backward Property


Forward Property Example

This example sets the number of units the trendline extends forward and backward.

With myChart.SeriesCollection(1).Trendlines(1)

.Forward = 5

.Backward = .5

End With


GapDepth Property

Example

Applies To

Chart

Description

Returns or sets the distance between the data series in a 3-D chart, as a percentage of the marker width (between 0 and 500). Read-write.

Syntax

object.GapDepth

Elements

object

Required. The Chart object.


GapDepth Property Example

This example sets the distance between the data series on a 3-D chart to 200 percent of the marker width.

myChart.GapDepth = 200


GapWidth Property

See Also	Example

Applies To

ChartGroup

Description

Returns or sets the space between bar or column clusters as a percentage of the width of a bar or column. This property must be between 0 and 500. Read-write.

Syntax

object.GapWidth

Elements

object

Required. The ChartGroup object.


See Also

Overlap Property


GapWidth Property Example

This example sets the space between column clusters to 50 percent of the width of a column.

myChart.ChartGroups(1).GapWidth = 50


HasAxis Property

See Also	Example

Applies To

Chart

Description

Indicates which Axes exist on the current chart, as a two-dimensional array of Boolean values. Read-write.

The first array dimension indicates the axis (one of xlCategory, xlValue, or xlSeries). Series axes apply only to 3-D charts.

The second array dimension indicates the axis group (xlPrimary or xlSecondary). Read-write. 3-D charts have only one set of axes.

Syntax

object.HasAxis

Elements

object

Required. The Chart object.

Remarks

Microsoft Graph may create or delete axes if you change the chart type or change the AxisGroup property.


See Also

Axes object


HasAxis Property Example

This example turns on the primary value axis for the chart.

myChart.HasAxis(xlValue, xlPrimary) = True


HasDataLabel Property

See Also	Example

Applies To

Point

Description

True if the point has a data label. Read-write.

Syntax

object.HasDataLabel

Elements

object

Required. The Point object.


See Also

ApplyDataLabels Method

DataLabel Property

HasDataLabels Property


HasDataLabel Property Example

This example turns on the data label for point seven on series three, and then sets the datalabel color.

With myChart.SeriesCollection(3).Points(7)

.HasDataLabel = True

.ApplyDataLabels type:=xlShowValue

.DataLabel.Font.Color = RGB(0, 0, 255)

End With


HasDataLabels Property

See Also	Example

Applies To

Series

Description

True if the series has data labels. Read-write.

Syntax

object.HasDataLabels

Elements

object

Required. The Series object.


See Also

ApplyDataLabels Method

HasDataLabel Property

DataLabel Property


HasDataLabels Property Example

This example turns on data labels for series three.

With myChart.SeriesCollection(3)

.HasDataLabels = True

.ApplyDataLabels type:=xlShowValue

End With


HasDropLines Property

See Also	Example

Applies To

ChartGroup

Description

True if the line or area chart has drop lines. Applies only to line and area charts. Read-write.

Syntax

object.HasDropLines

Elements

object

Required. The ChartGroup object.


See Also

DropLines Property


HasDropLines Property Example

This example turns on drop lines for the first chart group, and then sets their line style, weight, and color.

With myChart.ChartGroups(1)

.HasDropLines = True

With .DropLines.Border

.LineStyle = xlDash

.Weight = xlMedium

.Color = RGB(255, 0, 0)

End With

End With


HasErrorBars Property

See Also	Example

Applies To

Series

Description

True if the series has error bars. This property is not available on 3-D charts. Read-write.

Syntax

object.HasErrorBars

Elements

object

Required. The Series object.


See Also

ErrorBar Method

ErrorBars Property


HasErrorBars Property Example

This example sets the error bar color.

With myChart.SeriesCollection(1)

.HasErrorBars = True

.ErrorBars.Border.Color = RGB(0, 255, 0)

End With


HasHiLoLines Property

See Also	Example

Applies To

ChartGroup

Description

True if the line chart has high-low lines. Applies only to line charts. Read-write.

Syntax

object.HasHiLoLines

Elements

object

Required. The ChartGroup object.


See Also

HiLoLines Property


HasHiLoLines Property Example

This example turns on high-low lines for the first chart group, and then sets their line style, weight, and color.

With myChart.ChartGroups(1)

.HasHiLoLines = True

With .HiLoLines.Border

.LineStyle = xlDash

.Weight = xlMedium

.Color = RGB(255, 0, 0)

End With

End With


HasLegend Property

See Also	Example

Applies To

Chart

Description

True if the chart has a legend. Read-write.

Syntax

object.HasLegend

Elements

object

Required. The Chart object.


See Also

Legend Property


HasLegend Property Example

This example turns on the chart legend and then sets its color.

myChart.HasLegend = True

myChart.Legend.Font.Color = RGB(0,255,0)


HasMajorGridlines Property

See Also	Example

Applies To

Axis

Description

True if the axis has major gridlines. Only axes in the primary axis group can have gridlines. Read-write.

Syntax

object.HasMajorGridlines

Elements

object

Required. The Axis object.


See Also

AxisGroup Property

HasMinorGridlines Property

MajorGridlines Property

MinorGridlines Property


HasMajorGridlines Property Example

This example sets the color of the major gridlines for the value axis.

With myChart.Axes(xlValue)

If .HasMajorGridlines Then

.MajorGridlines.Border.Color = RGB(0, 0, 255)	'set color to blue

End If

End With


HasMinorGridlines Property

See Also	Example

Applies To

Axis

Description

True if the axis has minor gridlines. Only axes in the primary axis group can have gridlines. Read-write.

Syntax

object.HasMinorGridlines

Elements

object

Required. The Axis object.


See Also

AxisGroup Property

HasMajorGridlines Property

MajorGridlines Property

MinorGridlines Property


HasMinorGridlines Property Example

This example sets the color of the minor gridlines for the value axis.

With myChart.Axes(xlValue)

If .HasMinorGridlines Then

.MinorGridlines.Border.Color = RGB(0, 255, 0)	'set color to green

End If

End With


HasRadarAxisLabels Property

See Also	Example

Applies To

ChartGroup

Description

True if a radar chart has axis labels. Applies only to radar charts. Read-write.

Syntax

object.HasRadarAxisLabels

Elements

object

Required. The ChartGroup object.


See Also

RadarAxisLabels Property


HasRadarAxisLabels Property Example

This example turns on radar axis labels for the first chart group, and sets their color.

With myChart.ChartGroups(1)

.HasRadarAxisLabels = True

.RadarAxisLabels.Font.Color = RGB(255, 0, 0)

End With


HasSeriesLines Property

See Also	Example

Applies To

ChartGroup

Description

True if a stacked column or bar chart has series lines. Applies only to stacked column and bar charts. Read-write.

Syntax

object.HasSeriesLines

Elements

object

Required. The ChartGroup object.


See Also

SeriesLines Property


HasSeriesLines Property Example

This example turns on series lines for the first chart group, and then sets their line style, weight, and color.

With myChart.ChartGroups(1)

.HasSeriesLines = True

With .SeriesLines.Border

.LineStyle = xlDash

.Weight = xlMedium

.Color = RGB(255, 0, 0)

End With

End With


HasTitle Property

Example

Applies To

Axis, Chart

Description

True if the axis or chart has a visible title. Read-write.

Syntax

object.HasTitle

Elements

object

Required. The Axis or Chart object.

Remarks

An axis title is an AxisTitle object.

A chart title is a ChartTitle object.


HasTitle Property Example

This example sets the value axis title to read "Population Growth" in 17-point italic.

With myChart.Axes(xlValue)

.HasTitle = True

With .AxisTitle

.Caption = "Population Growth"

.Font.Italic = True

.Font.Size = 17

End With

End With


HasUpDownBars Property

See Also	Example

Applies To

ChartGroup

Description

True if a line chart has up and down bars. Applies only to line charts. Read-write.

Syntax

object.HasUpDownBars

Elements

object

Required. The ChartGroup object.


See Also

DownBars Property

UpBars Property


HasUpDownBars Property Example

This example turns on up and down bars for the first chart group, and then sets their colors.

With myChart.ChartGroups(1)

.HasUpDownBars = True

.DownBars.Interior.Color = RGB(255, 0, 0)

.UpBars.Interior.Color = RGB(0, 0, 255)

End With


Height Property

See Also	Example

Applies To

ChartArea, Legend, PlotArea

Description

Returns or sets the height of an object, in points (1/72 inch). Read-only for the ChartArea object.

Syntax

object.Height

Elements

object

Required. The object to which this property applies. Read-write.


See Also

Left Property

Top Property

Width Property


Height Property Example

This example sets the height of the chart legend  to one inch (72 points).

myChart.Legend.Height = 72


HeightPercent Property

See Also	Example

Applies To

Chart

Description

Returns or sets the height of a 3-D chart as a percentage of the chart width (between 5 and 500 percent). Read-write.

Syntax

object.HeightPercent

Elements

object

Required. The Chart object.


See Also

DepthPercent Property


HeightPercent Property Example

This example sets the chart height to 80 percent of its width.

myChart.HeightPercent = 80


HiLoLines Property

See Also	Example

Applies To

ChartGroup

Description

Returns or sets the HiLoLines for a series on a line chart. Applies only to line charts. Read-write.

Syntax

object.HiLoLines

Elements

object

Required. The ChartGroup object.


See Also

HasHiLoLines Property


HiLoLines Property Example

This example turns on high-low lines for the first chart group, and then sets their line style, weight, and color.

With myChart.ChartGroups(1)

.HasHiLoLines = True

With .HiLoLines.Border

.LineStyle = xlDash

.Weight = xlMedium

.Color = RGB(255, 0, 0)

End With

End With


HorizontalAlignment Property

See Also	Example

Applies To

AxisTitle, ChartTitle, DataLabel, DataLabels

Description

Returns or sets the horizontal alignment for the object. Can be one of xlCenter, xlDistributed, xlJustify, xlLeft, or xlRight for all objects. Read-write.

Syntax

object.HorizontalAlignment

Elements

object

Required. The object to which this property applies.

Remarks

The xlDistributed alignment style works only in Far East versions of Microsoft Graph.


See Also

VerticalAlignment Property


HorizontalAlignment Property Example

This example centers the chart title.

myChart.ChartTitle.HorizontalAlignment = xlCenter


Index Property

Example

Applies To

LegendEntry, Trendline

Description

Returns the index number of the object within the collection of similar objects. Read-only.

Syntax

object.Index

Elements

object

Required. The object to which this property applies.


Index Property Example

This example displays the index number of an object passed to this procedure.

MsgBox "The index number of this object is " & obj.Index


Intercept Property

See Also	Example

Applies To

Trendline

Description

Returns or sets the point where the trendline crosses the value axis. Read-write.

Syntax

object.Intercept

Elements

object

Required. The Trendline object.

Remarks

Setting this property causes the InterceptIsAuto property to be set to False.


See Also

InterceptIsAuto Property


Intercept Property Example

This example causes trendline one to cross the value axis at five.

myChart.SeriesCollection(1) _

.Trendlines(1).Intercept = 5


InterceptIsAuto Property

See Also	Example

Applies To

Trendline

Description

True if the point where the trendline crosses the value axis is automatically determined by the regression. Read-write.

Syntax

object.InterceptIsAuto

Elements

object

Required. The Trendline object.

Remarks

Setting the Intercept property causes this property to be set to False.


See Also

Intercept Property


InterceptIsAuto Property Example

This example causes the trendline intercept point to be automatically determined.

myChart.SeriesCollection(1) _

.Trendlines(1).InterceptIsAuto = True


Interior Property

Example

Applies To

AxisTitle, ChartArea, ChartTitle, DataLabel, DataLabels, DownBars, Floor, Legend, LegendKey, PlotArea, Point, Series, UpBars, Walls

Description

Returns or sets the Interior of the object. Read-write.

Syntax

object.Interior

Elements

object

Required. The object to which this property applies.


Interior Property Example

This example sets the interior color of the chart title .

myChart.ChartTitle.Interior.Color = RGB(255,0,0)


InvertIfNegative Property

Example

Applies To

LegendKey, Point, Series

Description

True if Microsoft Graph inverts the pattern in the item when it corresponds to a negative number. Read-write.

Syntax

object.InvertIfNegative

Elements

object

Required. The LegendKey, Point, or Series object.


InvertIfNegative Property Example

This example inverts the pattern for negative values on series one.

myChart.SeriesCollection(1).InvertIfNegative = True


Italic Property

Example

Applies To

Font

Description

True if the font is italic. Read-write.

Syntax

object.Italic

Elements

object

Required. The Font object (ChartTitle.Font, for example).


Italic Property Example

This example sets the font to italic for the chart title.

myChart.ChartTitle.Font.Italic = True


Item Method

Applies To

All collections

Description

Returns part of a collection. The Item method works like the accessor method for a collection. For example, the following code:

myChart.SeriesCollection.Item(1)

Is equivalent to:

myChart.SeriesCollection(1)

The Item method is not generally required; you can usually use the collection-accessor form. However, you may need to use the Item method to return part of a collection if you assign a variable to the collection and pass it to a function or sub procedure, as shown in the following example.

Sub UseItem(wk as SeriesCollection)

wk.Item(1).Type = xlColumn 	'must use Item here

End Sub


Left Property

See Also	Example

Applies To

AxisTitle, ChartArea, ChartTitle, DataLabel, DataLabels, Legend, PlotArea

Description

Returns or sets the position of the specified object, in points (1/72 inch). Read-write, except for the ChartArea and Range objects.

Syntax

object.Left

Elements

object

Required. The object to which this property applies.


See Also

Height Property

Top Property

Width Property


Left Property Example

This example moves the chart title so that it just touches the left edge of the first column.

myChart.ChartTitle.Left = 0


Legend Property

See Also	Example

Applies To

Chart

Description

Returns the Legend for the chart. Read-only.

Syntax

object.Legend

Elements

object

Required. The Chart object.


See Also

HasLegend Property


Legend Property Example

This example turns on the chart legend and then sets its color.

myChart.HasLegend = True

myChart.Legend.Font.Color = RGB(0,255,0)


LegendEntries Method

Example

Applies To

Legend

Description

Returns a single legend entry (a LegendEntry object, Syntax 1) or a collection of legend entries for the legend (a LegendEntries object, Syntax 2).

Syntax 1

object.LegendEntries(index)

Syntax 2

object.LegendEntries

Elements

The LegendEntries method has the following object qualifier and named arguments:

object

Required. The Legend object.

index

Required for Syntax 1. Specifies the name or number of the legend entry.


LegendEntries Method Example

This example selects legend entry three.

myChart.Legend.LegendEntries(3).Select


LegendKey Property

Example

Applies To

LegendEntry

Description

Returns the LegendKey object associated with the entry.

Syntax

object.LegendKey

Elements

object

Required. The LegendEntry object.


LegendKey Property Example

This example clears the formatting on the legend key for legend entry five.

myChart.Legend.LegendEntries(5).LegendKey.ClearFormats


Line3DGroup Property

Example

Applies To

Chart

Description

Returns the line ChartGroup on a 3-D chart.

Syntax

object.Line3DGroup

Elements

object

Required. The Chart object.


Line3DGroup Property Example

This example makes the 3-D line group an area group.

myChart.Line3DGroup.Type = xl3DArea


LineGroups Method

See Also	Example

Applies To

Chart

Description

On a 2-D chart, returns a single line chart group (a ChartGroup object, Syntax 1), or a collection of the line chart groups (a ChartGroups collection, Syntax 2).

Syntax 1

object.LineGroups(index)

Syntax 2

object.LineGroups

Elements

The LineGroups method has the following object qualifier and named arguments:

object

Required. The Chart object.

index

Required for Syntax 1. Specifies the chart group.


See Also

Line3DGroup Property


LineGroups Method Example

This example sets the subtype for the first line group.

myChart.LineGroups(1).SubType = 2


LineStyle Property

Example

Applies To

Border

Description

Returns or sets the line style of the border. Can be one of xlContinuous, xlDash, xlDot, xlDashDot, xlDashDotDot, xlGray50, xlGray75, xlGray25, xlDouble, xlNone, or xlAutomatic. Read-write.

Syntax

object.LineStyle

Elements

object

Required. The Border or Borders object.


LineStyle Property Example

This example sets major gridlines on the value axis to 50 percent gray.

myChart.Axes(xlValue).MajorGridlines.Border.LineStyle = xlGray50


MajorGridlines Property

See Also	Example

Applies To

Axis

Description

Returns the major Gridlines for the specified axis. Only axes in the primary axis group can have gridlines. Read-only.

Syntax

object.MajorGridlines

Elements

object

Required. The Axis object.


See Also

AxisGroup Property

HasMajorGridlines Property

HasMinorGridlines Property

MinorGridlines Property


MajorGridlines Property Example

This example sets the color of the major gridlines for the value axis.

With myChart.Axes(xlValue)

If .HasMajorGridlines Then

.MajorGridlines.Border.Color = RGB(0, 0, 255)	'set color to blue

End If

End With


MajorTickMark Property

See Also	Example

Applies To

Axis

Description

Returns or sets the type of major tick mark for the specified axis (one of xlNone, xlInside, xlOutside, or xlCross). Read-write.

Syntax

object.MajorTickMark

Elements

object

Required. The Axis object.


See Also

MinorTickMark Property


MajorTickMark Property Example

This example sets the value axis to use outside major tick marks.

myChart.Axes(xlValue).MajorTickMark = xlOutside


MajorUnit Property

See Also	Example

Applies To

Axis

Description

Returns or sets the major units for the value axis. Applies only to the value axis. Read-write.

Syntax

object.MajorUnit

Elements

object

Required. The Axis object.

Remarks

Setting this property sets the MajorUnitIsAuto property to False.

Use the TickMarkSpacing property to set tick mark spacing on the category axis.


See Also

MajorUnitIsAuto Property

MinorUnit Property

MinorUnitIsAuto Property

TickMarkSpacing Property


MajorUnit Property Example

This example sets the major and minor units for the value axis.

With myChart.Axes(xlValue)

.MajorUnit = 100

.MinorUnit = 20

End With


MajorUnitIsAuto Property

See Also	Example

Applies To

Axis

Description

True if Microsoft Graph calculates major units for the value axis. Applies only to the value axis. Read-write.

Syntax

object.MajorUnitIsAuto

Elements

object

Required. The Axis object.

Remarks

Setting the MajorUnit property sets this property to False.


See Also

MajorUnit Property

MinorUnit Property

MinorUnitIsAuto Property


MajorUnitIsAuto Property Example

This example sets Microsoft Graph to calculate major and minor units for the value axis.

With myChart.Axes(xlValue)

.MajorUnitIsAuto = True

.MinorUnitIsAuto = True

End With


MarkerBackgroundColor Property

See Also	Example

Applies To

LegendKey, Point, Series

Description

Returns or sets the marker background color as an RGB value. Line, scatter and radar charts only. Read-write.

Syntax

object.MarkerBackgroundColor

Elements

object

Required. The LegendKey, Point, or Series object.


See Also

MarkerBackgroundColorIndex Property

MarkerForegroundColor Property

MarkerStyle Property


MarkerBackgroundColor Property Example

This example sets the marker background and foreground color for the second point on a series.

With myChart.SeriesCollection(1).Points(2)

.MarkerBackgroundColor = RGB(0,255,0)

.MarkerForegroundColor = RGB(255,0,0)

End With


MarkerBackgroundColorIndex Property

See Also	Example

Applies To

LegendKey, Point, Series

Description

Returns or sets the marker background color as an index into the current color palette (a value from one to 56, or xlNone if there is no background color). Line, scatter and radar charts only. Read-write.

Syntax

object.MarkerBackgroundColorIndex

Elements

object

Required. The LegendKey, Point, or Series object.


See Also

MarkerBackgroundColor Property

MarkerForegroundColorIndex Property

MarkerStyle Property


MarkerBackgroundColorIndex Property Example

This example sets the marker background and foreground color (as an index) for the second point on a series.

With myChart.SeriesCollection(1).Points(2)

.MarkerBackgroundColorIndex = 1

.MarkerForegroundColorIndex = 2

End With


MarkerForegroundColor Property

See Also	Example

Applies To

LegendKey, Point, Series

Description

Returns or sets the foreground color of the marker, specified as an RGB value. Line, scatter and radar charts only. Read-write.

Syntax

object.MarkerForegroundColor

Elements

object

Required. The LegendKey, Point, or Series object.


See Also

MarkerBackgroundColor Property

MarkerForegroundColorIndex Property

MarkerStyle Property


MarkerForegroundColor Property Example

This example sets the marker background and foreground color for the second point on a series.

With myChart.SeriesCollection(1).Points(2)

.MarkerBackgroundColor = RGB(0,255,0)

.MarkerForegroundColor = RGB(255,0,0)

End With


MarkerForegroundColorIndex Property

See Also	Example

Applies To

LegendKey, Point, Series

Description

Returns or sets the marker foreground color as an index into the current color palette (a value from one to 56, or xlNone if there is no foreground color). Line, scatter and radar charts only. Read-write.

Syntax

object.MarkerForegroundColorIndex

Elements

object

Required. The LegendKey, Point, or Series object.


See Also

MarkerForegroundColor Property

MarkerBackgroundColorIndex Property

MarkerStyle Property


MarkerForegroundColorIndex Property Example

This example sets the marker background and foreground color (as an index) for the second point on a series.

With myChart.SeriesCollection(1).Points(2)

.MarkerBackgroundColorIndex = 1

.MarkerForegroundColorIndex = 2

End With


MarkerStyle Property

Example

Applies To

LegendKey, Point, Series

Description

Returns or sets the marker style for a point or series on a line chart, a scatter chart, or a radar chart. Read-write.

Syntax

object.MarkerStyle

Elements

object

Required. The LegendKey, Point or Series object.

Remarks

This property can have one of the following values.

Value	Meaning

xlNone	No markers.

xlAutomatic	Automatic markers.

xlSquare	Square markers.

xlDiamond	Diamond-shaped markers.

xlTriangle	Triangular markers.

xlX	Square markers with an X.

xlStar	Square markers with an asterisk.

xlDot	Short bar markers.

xlDash	Long bar markers.

xlCircle	Circular markers.

xlPlus	Square markers with a plus sign.

xlPicture	Picture markers.


MarkerStyle Property Example

This example sets the marker style for the first series.

myChart.SeriesCollection(1).MarkerStyle = xlCircle


MaximumScale Property

See Also	Example

Applies To

Axis

Description

Returns or sets the maximum value on the value axis. Applies only to the value axis. Read-write.

Syntax

object.MaximumScale

Elements

object

Required. The Axis object.

Remarks

Setting this property sets the MaximumScaleIsAuto property to False.


See Also

MinimumScale Property

MaximumScaleIsAuto Property

MinimumScaleIsAuto Property


MaximumScale Property Example

This example sets the maximum and minimum values for the value axis.

With myChart.Axes(xlValue)

.MinimumScale = 10

.MaximumScale = 120

End With


MaximumScaleIsAuto Property

See Also	Example

Applies To

Axis

Description

True if Microsoft Graph calculates the maximum value for the value axis. Applies only to the value axis. Read-write.

Syntax

object.MaximumScaleIsAuto

Elements

object

Required. The Axis object.

Remarks

Setting the MaximumScale property sets this property to False.


See Also

MaximumScale Property

MinimumScale Property

MinimumScaleIsAuto Property


MaximumScaleIsAuto Property Example

This example sets Microsoft Graph to calculate the minimum and maximum values for the value axis.

With myChart.Axes(xlValue)

.MinimumScaleIsAuto = True

.MaximumScaleIsAuto = True

End With


MinimumScale Property

See Also	Example

Applies To

Axis

Description

Returns or sets the minimum value on the value axis. Applies only to the value axis. Read-write.

Syntax

object.MinimumScale

Elements

object

Required. The Axis object.

Remarks

Setting this property sets the MinimumScaleIsAuto property to False.


See Also

MaximumScale Property

MaximumScaleIsAuto Property

MinimumScaleIsAuto Property


MinimumScale Property Example

This example sets the maximum and minimum values on the value axis.

With myChart.Axes(xlValue)

.MinimumScale = 10

.MaximumScale = 120

End With


MinimumScaleIsAuto Property

See Also	Example

Applies To

Axis

Description

True if Microsoft Graph calculates the minimum value for the value axis. Applies only to the value axis. Read-write.

Syntax

object.MinimumScaleIsAuto

Elements

object

Required. The Axis object.

Remarks

Setting the MinimumScale property sets this property to False.


See Also

MaximumScale Property

MaximumScaleIsAuto Property

MinimumScale Property


MinimumScaleIsAuto Property Example

This example sets Microsoft Graph to calculate the minimum and maximum values for the value axis.

With myChart.Axes(xlValue)

.MinimumScaleIsAuto = True

.MaximumScaleIsAuto = True

End With


MinorGridlines Property

See Also	Example

Applies To

Axis

Description

Returns the minor Gridlines for the specified axis. Only axes in the primary axis group can have gridlines. Read-only.

Syntax

object.MinorGridlines

Elements

object

Required. The Axis object.


See Also

AxisGroup Property

HasMajorGridlines Property

HasMinorGridlines Property

MajorGridlines Property


MinorGridlines Property Example

This example sets the color of the minor gridlines for the value axis.

With myChart.Axes(xlValue)

If .HasMinorGridlines Then

.MinorGridlines.Border.Color = RGB(0, 0, 255)	'set color to blue

End If

End With


MinorTickMark Property

See Also	Example

Applies To

Axis

Description

Returns or sets the type of minor tick mark for the specified axis (one of xlNone, xlInside, xlOutside, or xlCross). Read-write.

Syntax

object.MinorTickMark

Elements

object

Required. The Axis object.


See Also

MajorTickMark Property


MinorTickMark Property Example

This example sets the category (x) axis to use inside minor tick marks.

myChart.Axes(xlCategory).MinorTickMark = xlInside


MinorUnit Property

See Also	Example

Applies To

Axis

Description

Returns or sets the minor units on the value axis. Applies only to the value axis. Read-write.

Syntax

object.MinorUnit

Elements

object

Required. The Axis object.

Remarks

Setting this property sets the MinorUnitIsAuto property to False.

Use the TickMarkSpacing property to set tick mark spacing on the category axis.


See Also

MajorUnit Property

MajorUnitIsAuto Property

MinorUnitIsAuto Property

TickMarkSpacing Property


MinorUnit Property Example

This example sets the major and minor units for the value axis.

With myChart.Axes(xlValue)

.MajorUnit = 100

.MinorUnit = 20

End With


MinorUnitIsAuto Property

See Also	Example

Applies To

Axis

Description

True if Microsoft Graph calculates minor units for the value axis. Applies only to the value axis. Read-write.

Syntax

object.MinorUnitIsAuto

Elements

object

Required. The Axis object.

Remarks

Setting the MinorUnit property sets this property to False.


See Also

MajorUnit Property

MajorUnitIsAuto Property

MinorUnit Property


MinorUnitIsAuto Property Example

This example sets Microsoft Graph to calculate major and minor units for the value axis.

With myChart.Axes(xlValue)

.MajorUnitIsAuto = True

.MinorUnitIsAuto = True

End With


Name Property

Example

Applies To

Application, AxisTitle, ChartArea, ChartTitle, DataLabel, DataLabels, DownBars, DropLines, ErrorBars, Floor, Font, Gridlines, HiLoLines, Legend, PlotArea, SeriesLines, TickLabels, Trendline, UpBars, Walls

Description

Returns or sets the name of the object.

Syntax

object.Name

Elements

object

Required. The object to which this property applies.


Name Property Example

This example assigns the name of the first trendline to the variable trendname.

myTrendname = myChart.SeriesCollection(1).Trendlines(1).Name


NameIsAuto Property

Example

Applies To

Trendline

Description

True if Microsoft Graph automatically determines the name of the trendline. Read-write.

Syntax

object.NameIsAuto

Elements

object

Required. The Trendline object.


NameIsAuto Property Example

This example cause Microsoft Graph to automatically determine the name for trendline one.

myChart.SeriesCollection(1) _

.Trendlines(1).NameIsAuto = True


NumberFormat Property

Example

Applies To

DataLabel, DataLabels, TickLabels

Description

Returns or sets the format code for the object (as a string). Read-write.

Syntax

object.NumberFormat

Elements

object

Required. The object to which this property applies.


Number Format Property Example

This example sets the number format property for the data labels of series one.

myChart.SeriesCollection(1).DataLabels.NumberFormat = "General"


Order Property

Example

Applies To

Trendline

Description

Returns or sets the trendline order (an integer greater than one) when the trendline Type is xlPolynomial. Read-write.

Syntax

object.Order

Elements

object

Required. The Trendline object.


Order Property Example

This example sets the order of the first trendline of series one if it is polynomial.

With myChart.SeriesCollection(1).Trendlines(1)

If .Type = xlPolynomial Then .Order = 3

End With


Orientation Property

Example

Applies To

AxisTitle, ChartTitle, DataLabel, DataLabels, TickLabels

Description

Returns or sets the text orientation. One of xlHorizontal, xlVertical, xlUpward, or xlDownward. Can also be xlAutomatic for TickLabels only.

Syntax

object.Orientation

Elements

object

Required. The object to which this property applies.


Orientation Property Example

This example sets the orientation for the chart title.

myChart.ChartTitle = xlHorizontal


OutlineFont Property

Example

Applies To

Font

Description

True if the font is an outline font. Read-write.

Syntax

object.OutlineFont

Elements

object

Required. The Font object.

Remarks

This property has no effect in Microsoft Windows, but its value is retained (it can be set and returned).


OutlineFont Property Example

This example sets the font for the chart title to an outline font.

myChart.ChartTitle.Font.OutlineFont = True


Overlap Property

See Also	Example

Applies To

ChartGroup

Description

Specifies how bars and columns are positioned. Can be a value from -100 to 100. Applies only to bar and column charts. Read-write.

Syntax

object.Overlap

Elements

object

Required. The ChartGroup object.

Remarks

If this property is set to -100, bars are positioned so that there is one bar width between them. With zero overlap, there is no space between bars (one bar starts immediately after the preceding bar). At 100 overlap, bars are positioned on top of each other.


See Also

GapWidth Property


Overlap Property Example

This example sets the overlap for the first chart group to -50.

myChart.ChartGroups(1).Overlap = -50


Parent Property

Example

Applies To

All objects

Description

Returns the parent object for the specified object. Read-only.

Syntax

object.Parent

Elements

object

Required. The object to which this property applies.


Parent Property Example

This example displays the name of the chart that contains myAxis.

Set myAxis = myChart.Axes(xlValue)

MsgBox myAxis.Parent.Name


Pattern Property

See Also	Example

Applies To

Interior

Description

Returns or sets the pattern of the interior. Read-write.

Syntax

object.Pattern

Elements

object

Required. The Interior object.

Remarks

This property can have one of the following values.

xlAutomatic xlChecker xlCrissCross xlDown xlGray16 xlGray25 xlGray50 xlGray75 xlGray8 xlGrid	xlHorizontal xlLightDown xlLightHorizontal xlLightUp xlLightVertical xlNone xlSemiGray75 xlSolid xlUp xlVertical


See Also

PatternColor Property


Pattern Property Example

This example adds a crisscross pattern to the interior of the plot area.

myChart.PlotArea.Interior.Pattern = xlCrissCross


PatternColor Property

See Also	Example

Applies To

Interior

Description

Returns or sets the interior pattern color as an RGB value. Read-write.

Syntax

object.PatternColor

Elements

object

Required. The Interior object.


See Also

Color Property

Pattern Property

PatternColorIndex Property


PatternColor Property Example

This example sets the interior pattern color for the chart area.

myChart.ChartArea.Interior.PatternColor = RGB(255,0,0)


PatternColorIndex Property

See Also	Example

Applies To

Interior

Description

Returns or sets the interior pattern color as an index into the current color palette. Read-write.

Syntax

object.PatternColorIndex

Elements

object

Required. The Interior object.

Remarks

Set this property to xlAutomatic to specify the automatic pattern for cells or the automatic fill style for drawing objects. Set this property to xlNone to specify no pattern (this is the same as setting Interior.Pattern to xlNone).


See Also

Color Property

Pattern Property

PatternColor Property


PatternColorIndex Property Example

This example sets the pattern color (as an index) for the chart area.

myChart.ChartArea.Interior.PatternColorIndex = 5


Period Property

See Also	Example

Applies To

Trendline

Description

Returns or sets the period of the trendline (applies only if this is a moving average trendline; its Type property must be xlMovingAvg). Read-write.

Syntax

object.Period

Elements

object

Required. The Trendline object.


See Also

Type Property


Period Property Example

This example sets the period for trendline one if its type is xlMovingAvg.

With myChart.SeriesCollection(1).Trendlines(1)

If .Type = xlMovingAvg Then .Period = 10

End With


Perspective Property

See Also	Example

Applies To

Chart

Description

Returns or sets the perspective for the 3-D chart view. Must be between 0 and 100. This property is ignored if the RightAngleAxes property is True. Read-write.

Syntax

object.Perspective

Elements

object

Required. The Chart object.


See Also

Elevation Property

RightAngleAxes Property

Rotation Property


Perspective Property Example

This example sets the chart perspective to 70.

myChart.Perspective = 70


PictureType Property

See Also	Example

Applies To

Point, Series

Description

Returns or sets how pictures are displayed on a column or bar picture chart, as shown in the following table. Applies only to column and bar picture charts. Read-write.

Value	Meaning

xlStretch	Stretch the picture to reach the necessary value.

xlStack 	Stack the pictures to reach the necessary value.

xlScale 	Stack the pictures, but use the PictureUnit property to determine what unit each picture represents.

Syntax

object.PictureType

Elements

object

Required. The Point or Series object.


See Also

PictureUnit Property


PictureType Property Example

This example sets the first series to stretch pictures.

myChart.SeriesCollection(1).PictureType = xlStretch


PictureUnit Property

See Also	Example

Applies To

Point, Series

Description

Returns or sets the unit for each picture on a column or bar picture chart if the PictureType property is set to xlScale (if not, this property is ignored). Read-write.

Syntax

object.PictureUnit

Elements

object

Required. The Point or Series object.


See Also

PictureType Property


PictureUnit Property Example

This example sets the first series to stack pictures and uses each picture to represent five units.

With myChart.SeriesCollection(1)

.PictureType = xlScale

.PictureUnit = 5

End With


Pie3DGroup Property

See Also	Example

Applies To

Chart

Description

Returns the pie ChartGroup on a 3-D chart. Read-write.

Syntax

object.Pie3DGroup

Elements

object

Required. The Chart object.


See Also

PieGroups Method


Pie3DGroup Property Example

This example makes the 3-D pie group a 3-D area group.

myChart.Pie3DGroup.Type = xl3DArea


PieGroups Method

See Also	Example

Applies To

Chart

Description

On a 2-D chart, returns a single pie chart group (a ChartGroup object, Syntax 1), or a collection of the pie chart groups (a ChartGroups collection, Syntax 2).

Syntax 1

object.PieGroups(index)

Syntax 2

object.PieGroups

Elements

The PieGroups method has the following object qualifier and named arguments:

object

Required. The Chart object.

index

Required for Syntax 1. Specifies the chart group.


See Also

Pie3DGroup Property


PieGroups Method Example

This example makes the first pie group an area group.

myChart.PieGroups(1).Type = xlArea


PlotArea Property

Example

Applies To

Chart

Description

Returns the PlotArea of a chart. Read-only.

Syntax

object.PlotArea

Elements

object

Required. The Chart object.


PlotArea Property Example

This example sets the chart plot area color.

myChart.PlotArea.Border.Color = RGB(255,0,0)


Points Method

Example

Applies To

Series

Description

Returns a single point (a Point object, Syntax 1) or a collection of all of the points (a Points object, Syntax 2) in the series. Read-only.

Syntax 1

object.Points(index)

Syntax 2

object.Points

Elements

The Points method has the following object qualifier and named arguments:

object

Required. The Series object.

index

Required for Syntax 1. The name or number of the point.


Points Method Example

This example applies a data label to the first point in the series.

myChart.SeriesCollection(1).Points(1).ApplyDataLabels


Position Property

Example

Applies To

Legend

Description

Returns or sets the position of the legend on the chart. One of xlBottom, xlCorner, xlTop, xlRight, or xlLeft.

Syntax

object.Position

Elements

object

Required. The Legend object.


Position Property Example

This example sets the position of the legend to the top of the chart.

myChart.Legend.Position = xlTop


RadarAxisLabels Property

See Also	Example

Applies To

ChartGroup

Description

Returns or sets the radar axis labels (a TickLabels collection) for this chart group. Read-write.

Syntax

object.RadarAxisLabels

Elements

object

Required. The ChartGroup object.


See Also

HasRadarAxisLabels Property


RadarAxisLabels Property Example

This example turns on radar axis labels for the first chart group, and sets their color.

With myChart.ChartGroups(1)

.HasRadarAxisLabels = True

.RadarAxisLabels.Font.Color = RGB(255, 0, 0)

End With


RadarGroups Method

Example

Applies To

Chart

Description

On a 2-D chart, returns a single radar chart group (a ChartGroup object, Syntax 1), or a collection of the radar chart groups (a ChartGroups collection, Syntax 2).

Syntax 1

object.RadarGroups(index)

Syntax 2

object.RadarGroups

Elements

The RadarGroups method has the following object qualifier and named arguments:

object

Required. The Chart object.

index

Required for Syntax 1. Specifies the chart group.


RadarGroups Method Example

This example makes the first radar group a filled radar group.

myChart.RadarGroups(1).SubType = 2


ReversePlotOrder Property

Example

Applies To

Axis

Description

True if Microsoft Graph plots points from last to first. Read-write.

Syntax

object.ReversePlotOrder

Elements

object

Required. The Axis object.

Remarks

This property is not available for radar charts.


ReversePlotOrder Property Example

This example sets Microsoft Graph to plot points on the value axis from last to first.

myChart.Axes(xlValue).ReversePlotOrder = True


RightAngleAxes Property

See Also	Example

Applies To

Chart

Description

True if the chart axes are at right angles, independent of chart rotation or elevation. Applies only to 3-D line, column, and bar charts. Read-write.

Syntax

object.RightAngleAxes

Elements

object

Required. The Chart object.

Remarks

If this property is True, the Perspective property is ignored.


See Also

Elevation Property

Perspective Property

Rotation Property


RightAngleAxes Property Example

This example sets the axes at right angles, independent of chart rotation or elevation.

myChart.RightAngleAxes = True


Rotation Property

See Also	Example

Applies To

Chart

Description

Returns or sets the rotation of the 3-D chart view (the rotation of the plot area around the z-axis, in degrees). The value of this property must be between 0 and 360, except for 3-D Bar charts, where the value must be between 0 and 44. The default value is 20. Applies only to 3-D charts. Read-write.

Syntax

object.Rotation

Elements

object

Required. The Chart object.


See Also

Elevation Property

Perspective Property

RightAngleAxes Property


Rotation Property Example

This example sets the 3-D chart rotation to 30 degrees.

myChart.Rotation = 30


ScaleType Property

Example

Applies To

Axis

Description

Returns or sets the value axis scale type (xlLinear or xlLogarithmic). Applies only to the value axis. Read-write.

Syntax

object.ScaleType

Elements

object

Required. The Axis object.

Remarks

A logarithmic scale uses base ten logarithms.


ScaleType Property Example

This example sets the value axis to use a logarithmic scale.

myChart.Axes(xlValue).ScaleType = xlLogarithmic


SeriesCollection Method

Example

Applies To

Chart, ChartGroup

Description

Returns a single series (a Series object, Syntax 1) or a collection of all the series (a SeriesCollection object, Syntax 2) in the chart or chart group. Read-only.

Syntax 1

object.SeriesCollection(index)

Syntax 2

object.SeriesCollection

Elements

The SeriesCollection method has the following object qualifier and named arguments:

object

Required. The Chart or ChartGroup object.

index

Required for Syntax 1. The name or number of the series.


SeriesCollection Method Example

This example turns on data labels for series one.

myChart.SeriesCollection(1).HasDataLabels = True


SeriesLines Property

See Also	Example

Applies To

ChartGroup

Description

Returns or sets the SeriesLines for a stacked bar or stacked column chart. Applies only to stacked bar and stacked column charts. Read-write.

Syntax

object.SeriesLines

Elements

object

Required. The ChartGroup object.


See Also

HasSeriesLines Property


SeriesLines Property Example

This example turns on series lines for the first chart group, and then sets their line style, weight, and color.

With myChart.ChartGroups(1)

.HasSeriesLines = True

With .SeriesLines.Border

.LineStyle = xlDash

.Weight = xlMedium

.Color = RGB(255, 0, 0)

End With

End With


Shadow Property

Example

Applies To

AxisTitle, ChartArea, ChartTitle, DataLabel, DataLabels, Font, Legend

Description

True if the font is a shadow font or if the drawing object has a shadow. Read-write.

Syntax

object.Shadow

Elements

object

Required. The object to which this property applies.

Remarks

For the Font object, this property has no effect in Microsoft Windows, but its value is retained (it can be set and returned).


Shadow Property Example

This example adds a shadow to the chart title.

myChart.ChartTitle.Shadow = True


ShowLegendKey Property

Example

Applies To

DataLabel, DataLabels

Description

True if the data label legend key is visible. Read-write.

Syntax

object.ShowLegendKey

Elements

object

Required. The DataLabel or DataLabels object.


ShowLegendKey Property Example

This example sets the data labels for series one to show values and the legend key.

With myChart.SeriesCollection(1).DataLabels

.ShowLegendKey = True

.Type = xlShowValue

End With


Size Property

Example

Applies To

Font

Description

Returns or sets the size of the font. Read-write.

Syntax

object.Size

Elements

object

Required. The Font object.


Size Property Example

This example sets the font size for the chart title.

myChart.ChartTitle.Font.Size = 12


Smooth Property

Example

Applies To

LegendKey, Series

Description

True if the line or scatter chart has curve smoothing on. Applies only to line and scatter charts. Read-write.

Syntax

object.Smooth

Elements

object

Required. The LegendKey or Series object.


Smooth Property Example

This example turns curve smoothing on.

myChart.SeriesCollection(7).Smooth = True


Strikethrough Property

Example

Applies To

Font

Description

True if the font is struck through. Read-write.

Syntax

object.Strikethrough

Elements

object

Required. The Font object (ChartTitle.Font, for example).


Strikethrough Property Example

This example sets the font of the chart title to strikethrough.

myChart.ChartTitle.Font.Strikethrough = True


Subscript Property

See Also	Example

Applies To

Font

Description

True if the font is subscripted. Read-write.

Syntax

object.Subscript

Elements

object

Required. The Font object.

Remarks

This property is False by default.


See Also

Superscript Property


Subscript Property Example

This example makes the font in the chart title  a subscript.

myChart.ChartTitle.Font.Subscript = True


SubType Property

Example

Applies To

Chart, ChartGroup

Description

Returns or sets the subtype for a single chart group or for all chart groups in the chart.

Syntax

object.SubType

Elements

object

Required. The Chart or ChartGroup object.

Remarks

Set the SubType property after you set the Type property. Each type supports different subtypes (for example, a column chart type can have clustered, stacked, or percent subtypes).


SubType Property Example

This example sets the subtype for the first radar chart group.

myChart.RadarGroups(1).SubType = 2


Superscript Property

See Also	Example

Applies To

Font

Description

True if the font is superscripted. Read-write.

Syntax

object.Superscript

Elements

object

Required. The Font object.

Remarks

This property is False by default.


See Also

Subscript Property


Superscript Property Example

This example makes the font in the chart title  a superscript.

myChart.ChartTitle.Font.Superscript = True


SurfaceGroup Property

Example

Applies To

Chart

Description

Returns the surface ChartGroup of a 3-D chart.

Syntax

object.SurfaceGroup

Elements

object

Required. The Chart object.


SurfaceGroup Property Example

This example makes the surface group an area group.

myChart.SurfaceGroup.Type = xlArea


Text Property

Example

Applies To

AxisTitle, ChartTitle, DataLabel, DataLabels

Description

Returns or sets the text for the specified object, as shown in the following table. Read-write.

Object	Text

AxisTitle, ChartTitle	The title text.

DataLabel	The data label text.

Syntax

object.Text

Elements

object

Required. The object to which this property applies.


Text Property Example

This example changes the text of the chart title.

myChart.ChartTitle.Text = "New"


TickLabelPosition Property

See Also	Example

Applies To

Axis

Description

Describes the position of tick labels on the specified axis (one of xlNone, xlLow, xlHigh, or xlNextToAxis). Read-write.

Syntax

object.TickLabelPosition

Elements

object

Required. The Axis object.


See Also

MajorTickMark Property

MinorTickMark Property

TickLabels Property

TickLabelSpacing Property

TickMarkSpacing Property


TickLabelPosition Property Example

This example sets tick labels on the category (x) axis to the high position (above the chart).

myChart.Axes(xlCategory).TickLabelPosition = xlHigh


TickLabels Property

See Also	Example

Applies To

Axis

Description

Returns the TickLabels for the specified axis. Read-only.

Syntax

object.TickLabels

Elements

object

Required. The Axis object.


See Also

MajorTickMark Property

MinorTickMark Property

TickLabelPosition Property

TickLabelSpacing Property

TickMarkSpacing Property


TickLabels Property Example

This example sets the color of the tick labels on the value axis.

myChart.Axes(xlValue).TickLabels.Font.Color = RGB(0, 255, 0)


TickLabelSpacing Property

See Also	Example

Applies To

Axis

Description

Returns or sets the number of categories or series between tick labels. Applies only to category and series axes. Read-write.

Syntax

object.TickLabelSpacing

Elements

object

Required. The Axis object.

Remarks

This property applies to the category and series axes only. Label spacing on the value axis is always calculated by Microsoft Graph.


See Also

MajorTickMark Property

MinorTickMark Property

TickLabelPosition Property

TickLabels Property

TickMarkSpacing Property


TickLabelSpacing Property Example

This example sets the number of categories between tick labels on the category (x) axis.

myChart.Axes(xlCategory).TickLabelSpacing = 10


TickMarkSpacing Property

See Also	Example

Applies To

Axis

Description

Returns or sets the number of categories or series between tick marks. Applies only to category and series axes. Read-write.

Syntax

object.TickMarkSpacing

Elements

object

Required. The Axis object.

Remarks

This property applies to the category and series axes only. Use the MajorUnit and MinorUnit properties to set tick mark spacing on the value axis.


See Also

MajorTickMark Property

MinorTickMark Property

MajorUnit Property

MinorUnit Property

TickLabelPosition Property

TickLabels Property

TickLabelSpacing Property


TickMarkSpacing Property Example

This example sets the sets the number of categories between tick marks on the category (x) axis.

myChart.Axes(xlCategory).TickMarkSpacing = 10


Top Property

See Also	Example

Applies To

AxisTitle, ChartArea, ChartTitle, DataLabel, DataLabels, Legend, PlotArea

Description

Returns or sets the position of the specified object, in points (1/72 inch). Read-write, except for the ChartArea object.

Syntax

object.Top

Elements

object

Required. The object to which this property applies.


See Also

Left Property

Height Property

Width Property


Top Property Example

This example sets the top of the chart title.

myChart.ChartTitle.Top = 10


Trendlines Method

Example

Applies To

Series

Description

Returns a single trendline (a Trendline object, Syntax 1) or a collection of all the trendlines (a Trendlines object, Syntax 2) for the series.

Syntax 1

object.Trendlines(index)

Syntax 2

object.Trendlines

Elements

object

Required. The Series object.

index

Required for Syntax 1. The name or number of the trendline.


Trendlines Method Example

This example sets the type of the first trendline.

myChart.SeriesCollection(1).Trendlines(1).Type = xlLinear


Type Property

See Also	Example

Applies To

Axis, Chart, ChartGroup, DataLabel, DataLabels, Series, Trendline

Description

Returns the object type, as shown in the following table. Read-only.

Object	Type

Axis	Axis type. Can be one of xlCategory, xlValue, or xlSeries (only 3-D charts use xlSeries).

Chart	Chart type. Can be one of xl3DArea, xl3DBar, xl3DColumn, xl3DLine, xl3DPie, xl3DSurface, xlArea, xlBar, xlColumn, xlDoughnut, xlLine, xlPie, xlRadar, or xlXYScatter. If the chart has chart groups of more than one type, this property returns Null, but setting the property sets all the chart groups.

ChartGroup	ChartGroup type. Can be one of the values shown for the Chart object. If you set the chart group type to a type that is not on the chart, Microsoft Graph creates a new chart group.

DataLabel	DataLabel type (one of xlNone, xlShowValue, xlShowLabel, xlShowPercent, or xlShowLabelAndPercent)

Series	Series type. Can be one of the values shown for the Chart object. If you set the series type to a type that is not on the chart, Microsoft Graph creates a new chart group.

Trendline	Trendline type. Can be one of xlLinear, xlLogarithmic, xlExponential, xlPolynomial, xlMovingAvg, or xlPower.

Syntax

object.Type

Elements

object

Required. Return or set the type of this object.


See Also

SubType Property


Type Property Example

This example makes the first group an area group.

myChart.ChartGroups(1).Type = xlArea


Underline Property

Example

Applies To

Font

Description

Returns or sets the type of underline applied to the font, as shown in the following table. Read-write.

Value	Meaning

xlNone	No underline.

xlSingle	Single underline.

xlDouble	Double underline.

Syntax

object.Underline

Elements

object

Required. The Font object (ChartTitle.Font, for example).


Underline Property Example

This example sets the font in the chart title  to single underline.

myChart.ChartTitle.Font.Underline = xlSingle


UpBars Property

See Also	Example

Applies To

ChartGroup

Description

Returns the UpBars on a line chart. Applies only to line charts. Read-only.

Syntax

object.UpBars

Elements

object

Required. The ChartGroup object.


See Also

HasUpDownBars Property

DownBars Property


UpBars Property Example

This example turns on up and down bars for the first chart group, and then sets their colors.

With myChart.ChartGroups(1)

.HasUpDownBars = True

.DownBars.Interior.Color = RGB(0, 255, 0)

.UpBars.Interior.Color = RGB(255, 0, 0)

End With


VaryByCategories Property

Example

Applies To

ChartGroup

Description

If this property is True, Microsoft Graph assigns a different color or pattern to each data marker. The chart must contain only one series. Read-write.

Syntax

object.VaryByCategories

Elements

object

Required. The ChartGroup object.


VaryByCategories Property Example

This example assigns a different color or pattern to each data marker in the first chart group.

myChart.ChartGroups(1).VaryByCategories = True


VerticalAlignment Property

See Also	Example

Applies To

AxisTitle, ChartTitle, DataLabel, DataLabels

Description

Returns or sets the vertical alignment of the object (can be one of xlBottom, xlCenter, xlDistributed, xlJustify, or xlTop). Read-write.

Syntax

object.VerticalAlignment

Elements

object

Required. The object to which this property applies.

Remarks

The xlDistributed alignment style works only in Far East versions of Microsoft Graph.


See Also

HorizontalAlignment Property


VerticalAlignment Property Example

This example sets the vertical alignment of the chart title.

myChart.ChartTitle.VerticalAlignment = xlCenter


Walls Property

Example

Applies To

Chart

Description

Returns the Walls of the 3-D chart. Read-only.

Syntax

object.Walls

Elements

object

Required. The Chart object.


Walls Property Example

This example sets the wall color.

myChart.Walls.Border.Color = RGB(255,0,0)


WallsAndGridlines2D Property

Example

Applies To

Chart

Description

True if gridlines are drawn in 2-D on a 3-D chart. Read-write.

Syntax

object.WallsAndGridlines2D

Elements

object

Required. The Chart object.


WallsAndGridlines2D Property Example

This example causes Microsoft Graph to draw 2-D gridlines on the chart.

myChart.WallsAndGridlines2D = True


Weight Property

Example

Applies To

Border

Description

Returns or sets the the weight of the border (one of xlHairline, xlThin, xlMedium, or xlThick). Read-write.

Syntax

object.Weight

Elements

object

Required. The Border object.


Weight Property Example

This example sets the weight of the border for the chart area.

myChart.ChartArea.Border.Weight = xlMedium


Width Property

See Also	Example

Applies To

ChartArea, Legend, PlotArea

Description

Returns or sets an object's width in points (1/72 inch). Read-write, except for the ChartArea object.

Syntax

object.Width

Elements

object

Required. The object to which this property applies.


See Also

Left Property

Height Property

Top Property


Width Property Example

This example sets the width of the legend.

myChart.Legend.Width = 100


XYGroups Method

Example

Applies To

Chart

Description

Returns a single scatter chart group (a ChartGroup object, Syntax 1), or a collection of the scatter chart groups (a ChartGroups collection, Syntax 2).

Syntax 1

object.XYGroups(index)

Syntax 2

object.XYGroups

Elements

The XYGroups method has the following object qualifier and named arguments:

object

Required. The Chart object.

index

Required for Syntax 1. Specifies the chart group.


XYGroups Method Example

This example makes the first scatter group an area group.

myChart.XYGroups(1).Type = xlArea


Chart Method

Example

Applies To

Application

Description

Returns the Microsoft Graph chart object.

Syntax

object.Chart

Elements

object

Required. The Application object.


Chart Method Example

This example sets myChart to the Microsoft Graph chart.

Set myChart = myApplication.Chart


ChartWizardDisplay Property

Example

Applies To

Application

Description

Turns display of the Chart Wizard on or off. Can be set to xlWizardDisplayAlways, xlWizardDisplayNever, or xlWizardDisplayDefault. Read-write.

Syntax

object.ChartWizardDisplay

Elements

object

Required. The Application object.


ChartWizardDisplay Property Example

This example turns display of the ChartWizard on.

myChart.Application.ChartWizardDisplay = True


OmitBackground Method

Example

Applies To

Chart

Description

Turns off gray plot area and walls.

Syntax

object.OmitBackground

Elements

object

Required. The Chart object.


OmitBackground Method Example

This example turns off the gray plot area and walls color.

myChart.OmitBackground = True


SaveAsOldFileFormat Method

Example

Applies To

Application

Description

Allows clients like Microsoft PowerPoint to save out in older format.

Syntax

object.SaveAsOldFileFormat(MajorVersion, MinorVersion)

Elements

object

Required. The Application object.

MajorVersion

Major version number of file format to use (usually 3)

MinorVersion

Minor version number of file format to use (usually 0)


SaveAsOldFileFormat Method Example

This example saves out the chart as Excel4 File format.

myChart.Application.SaveAsOldFileFormat MajorVersion:=4


Application Object

Properties	Methods

Description

The Application object contains application-wide settings and options (options in the Tools Options dialog box, for example)


Axes Object

Properties	Methods

Description

A collection of Axis objects.


Axis Object

Properties	Methods

Description

An axis on a chart.


AxisTitle Object

Properties	Methods

Description

An axis title (a graphic object) on a chart.


Border Object

Properties	Methods

Description

The border of a graphic object.


Chart Object

Properties	Methods

Description

The chart in Graph.


ChartArea Object

Properties	Methods

Description

The chart area of a chart.


ChartGroup Object

Properties	Methods

Description

A chart group on a chart.


ChartGroups Object

Properties	Methods

Description

A collection of ChartGroup objects.


ChartTitle Object

Properties	Methods

Description

The title of a chart.


DataLabel Object

Properties	Methods

Description

A data label on a chart series, or a data label on a single point of a chart series.


DataLabels Object

Properties	Methods

Description

A collection of all the DataLabel objects for the points on a series.


DownBars Object

Properties	Methods

Description

A down bar on a chart.


DropLines Object

Properties	Methods

Description

Drop lines on a chart.


ErrorBars Object

Properties	Methods

Description

Error bars on a chart.


Floor Object

Properties	Methods

Description

The floor of a 3-D chart.


Font Object

Properties	Methods

Description

A font description. The Font object contains all font attributes (font name, font size, color, and so on) as properties.


Gridlines Object

Properties	Methods

Description

Major gridlines or minor gridlines on a chart.


HiLoLines Object

Properties	Methods

Description

High-low lines on a chart.


Interior Object

Properties	Methods

Description

The interior of a graphic object.


Legend Object

Properties	Methods

Description

The legend of a chart.


LegendEntries Object

Properties	Methods

Description

A collection of LegendEntry objects.


LegendEntry Object

Properties	Methods

Description

Text and data marker labels contained within a charting legend.

Each legend entry has two parts. The LegendEntry object contains the text of the entry and a way to access the marker portion of the entry. The LegendKey object is associated with each entry. It encapsulates the formatting properties for the entry.

The text of a legend entry comes from the row and column headings. It cannot be changed. LegendEntry objects support font formatting, and they can be deleted. No pattern formatting is supported for legend entries. The position and size of entries cannot be changed.


LegendKey Object

Properties	Methods

Description

Text and data marker labels contained within a charting legend.

Each legend entry has two parts. The LegendEntry object contains the text of the entry and a way to access the marker portion of the entry. The LegendKey object is associated with each entry. It encapsulates the formatting properties for the entry. Formatting the LegendKey causes the entire series associated with the entry to be formatted.

The LegendKey object associated with an entry is accessed via a property of the LegendEntry object. The marker encapsulates pattern formatting for the legend marker and its associated series or trendline. Legend markers cannot be deleted or cleared.


PlotArea Object

Properties	Methods

Description

The plot area of a chart.


Point Object

Properties	Methods

Description

A single point in a series.


Points Object

Properties	Methods

Description

A collection of Point objects.


Series Object

Properties	Methods

Description

A series on a chart.


SeriesCollection Object

Properties	Methods

Description

A collection of Series objects.


SeriesLines Object

Properties	Methods

Description

Series lines on a bar or column chart.


TickLabels Object

Properties	Methods

Description

The text associated with tick marks on a chart axis.


Trendline Object

Properties	Methods

Description

A trend line on a chart.


Trendlines Object

Properties	Methods

Description

A collection of Trendline objects.


UpBars Object

Properties	Methods

Description

An up bar on a chart.


Walls Object

Properties	Methods

Description

The walls of a 3-D chart.


named arguments

An argument that has a predefined name. Instead of providing values for arguments in the order expected by the syntax, you can use named arguments to assign values in any order to only the arguments you want (if they are optional). For example, suppose a method accepts three arguments:

DoSomeThing namedarg1, namedarg2, namedarg3

By assigning values to named arguments, you can use the following statement:

DoSomeThing namedarg3:=4,namedarg2:=5

Note that the arguments need not be in their normal positional order.