メソッド

ScChartsObjのメソッド一覧を次に示す。

プロパティ 概要
SbxEMPTY queryInterface ( SbxOBJECT )
SbxOBJECT getElementType ( void )
SbxBOOL hasElements ( void )
SbxEMPTY getByName ( SbxSTRING )
SbxARRAY getElementNames ( void )
SbxBOOL hasByName ( SbxSTRING ) チャートの有無を返す
SbxVOID addNewByName ( SbxSTRING, SbxOBJECT, SbxARRAY, SbxBOOL, SbxBOOL ) チャートを追加する
SbxVOID removeByName ( SbxSTRING ) チャートを削除する
SbxOBJECT createEnumeration ( void )
SbxLONG getCount ( void )
SbxEMPTY getByIndex ( SbxLONG )
SbxSTRING getImplementationName ( void )
SbxBOOL supportsService ( SbxSTRING )
SbxARRAY getSupportedServiceNames ( void )
SbxARRAY getTypes ( void )
SbxARRAY getImplementationId ( void )
SbxOBJECT queryAdapter ( void )

hasByName

指定した名前のグラフ(チャート)が存在するか否かを判定する。

呼び出し形式

SbxBOOL hasByName(SbxSTRING)

OpenOffice.org Basicの呼び出し形式:

Function hasByName( name As String) As Boolean

戻り値

指定された名前のグラフ(チャート)が存在すればTrue、存在しなければFalseが返る。

使用例

Dim oCharts As Object

oCharts = ThisComponent.Sheets.getByName("表1").Charts

' グラフが無ければ追加する
If oCharts.hasByName("CandleChart") = False Then
    oCharts.addNewByName("CandleChart", Rect, RangeAddress(), True, True)
End If

addNewByName

新たにグラフ(チャート)を追加する。

呼び出し形式

SbxVOID addNewByName(SbxSTRING, SbxOBJECT, SbxARRAY, SbxBOOL, SbxBOOL)

OpenOffice.org Basicの呼び出し形式:

void addNewByName(String aName , com.sun.star.awt.Rectangle aRect , sequence<CellRangeAddress> aRanges , Boolean bRowHeaders , Boolean bColumnHeaders )

戻り値

無し

引数

aName
追加するグラフ(チャート)の名前
bRowHeaders
最初の行を項目名として使用する場合はTrue、使用しない場合はFalseを指定する。
bColumnHeaders
最初の列を項目名として使用する場合はTrue、使用しない場合はFalseを指定する。

removeByName

指定した名前のグラフ(チャート)を削除する。

呼び出し形式

SbxVOID removeByName(SbxSTRING)

OpenOffice.org Basicの呼び出し形式:

Sub removeByName( name As String)

戻り値

無し

name
削除するグラフ(チャート)の名前

使用例

Dim oCharts As Object

oCharts = ThisComponent.Sheets.getByName("表1").Charts

' グラフがあれば削除する
If oCharts.hasByName("CandleChart") = True Then
    oCharts.removeByName("CandleChart")
End If