![]() |
| サイトマップ | |
|
トップ | オブジェクト | プロパティ | メソッド | 定数 |
AutoLegend オブジェクトの実際の中身は、Solid オブジェクトと Text オブジェクトで構成される一種の Group オブジェクトです。AutoLegend オブジェクトを取得するには、Graph オブジェクトの AutoLegend プロパティを使います。
Graph オブジェクト |
プロパティ:Application , AutoLegend , Axes , ChildObjects , Color , Height , Left , Name , NameObject , ObjectType , OwnerGraphObject , Parent , Plots , StockScheme, Top , Width |
メソッド:GetAttribute, SelectObject, SetAttribute, SetObjectCurrent |
AutoLegend オブジェクトの操作は、Group オブジェクトを操作するのと同じです。AutoLegend オブジェクトのメンバーを取得するには、ChildObjects プロパティを使います。.ChildObjects(0) を指定すると、AutoLegend オブジェクトの境界線/背景として常に矩形の Solid オブジェクトが返ります。0 以上のインデックスを指定すると、凡例のキーとして使用される個々の Text オブジェクトが返ります。
Text オブジェクトの GetAttribute and SetAttribute メソッドを使用すれば、凡例にある各種 Text 属性を操作できます。FlagOff と FlagOn 関数を使用すれば、凡例や凡例のエントリーを表示・非表示にすることができます。
Series 1
" に変更します。
Dim SPLegend Set SPLegend = ActiveDocument.CurrentPageItem.GraphPages(0).Graphs(0).AutoLegend SPLegend.ChildObjects(1).Name = "Series 1"
Dim SPLegend Set SPLegend = ActiveDocument.CurrentPageItem.GraphPages(0).Graphs(0).AutoLegend SPLegend.ChildObjects(0).SetAttribute(SOA_EXTSHAPE,SOA_EXT_ELLIPSE) SPLegend.ChildObjects(0).SetAttribute(SDA_EDGECOLOR,RGB_BLUE)
FlagOn
"
関数を使えばエントリを表示させることができます。
Dim SPLegend Set SPLegend = ActiveDocument.CurrentPageItem.GraphPages(0).Graphs(0).AutoLegend SPLegend.ChildObjects(3).SetAttribute(STA_OPTIONS, FlagOff(STA_FLAG_VISIBLE))
Dim SPLegend Set SPLegend = ActiveDocument.CurrentPageItem.GraphPages(0).Graphs(0).AutoLegend SPLegend.SetAttribute(STA_OPTIONS, FlagOff(STA_FLAG_VISIBLE))