Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to access Text in Chart properties of Presentation tab using macro


Hi All,

Could anyone suggest how to access the Text in Chart properties of the presentation tab using Macro?

Thanks and regards,

Vj

1 Solution

Accepted Solutions
whiteline
Master II
Master II

Hi.

There is Texts array in the Chart properties.

set Graph = ActiveDocument.Sheets("Main").CreateBarChart

Graph.AddDimension "ProductType"

Graph.AddExpression "sum(Amount)"

Graph.AddText "My text",100,100

set p = Graph.GetProperties

p.ChartProperties.Texts(0).Position.Width = 100

p.ChartProperties.Texts(0).Position.Height = 25

p.ChartProperties.Texts(0).TextAdjust = 1      'center

p.ChartProperties.Texts(0).Transparent = false

p.ChartProperties.Texts(0).BgColor.PrimaryCol.IsCalculated = false

p.ChartProperties.Texts(0).BgColor.PrimaryCol.Col = RGB(255,255,0)   '

Graph.SetProperties p


Additional information about the text properties you can find at APIGuide.qvw.

The class name for the Text in Chart is IChartTextDef.

View solution in original post

1 Reply
whiteline
Master II
Master II

Hi.

There is Texts array in the Chart properties.

set Graph = ActiveDocument.Sheets("Main").CreateBarChart

Graph.AddDimension "ProductType"

Graph.AddExpression "sum(Amount)"

Graph.AddText "My text",100,100

set p = Graph.GetProperties

p.ChartProperties.Texts(0).Position.Width = 100

p.ChartProperties.Texts(0).Position.Height = 25

p.ChartProperties.Texts(0).TextAdjust = 1      'center

p.ChartProperties.Texts(0).Transparent = false

p.ChartProperties.Texts(0).BgColor.PrimaryCol.IsCalculated = false

p.ChartProperties.Texts(0).BgColor.PrimaryCol.Col = RGB(255,255,0)   '

Graph.SetProperties p


Additional information about the text properties you can find at APIGuide.qvw.

The class name for the Text in Chart is IChartTextDef.