チャートドキュメントオブジェクトの css.chart2.XChartDocument インターフェースの getFirstDiagram メソッドを利用してダイアグラムオブジェクトにアクセスできます。このオブジェクトはチャートにあるほとんどの要素に関するデータを保持しています。
Sub GetDiagram oSheet = ThisComponent.getSheets().getByIndex(0) oChart = oSheet.getCharts().getByIndex(0).getEmbeddedObject() oFirstDiagram = oChart.getFirstDiagram() End Sub
getDiagram メソッドで取得できるオブジェクトは旧来の css.chart モジュールのダイアグラムです。現在のチャートの機能を利用しきるにはこれでは不十分です。getFirstDiagram メソッドで取得したダイアグラムで css.chart2 モジュールの機能を利用してください。
ダイアグラムからチャートのデータにアクセスできます。
ダイアグラムからアクセスできるオブジェクト
以下のサブオブジェクトへ該当するメソッドを利用してアクセスできます。
| 名前 | 型 | 説明 |
|---|---|---|
| Wall | .beans.XPropertySet | 壁面のプロパティ設定 |
| Floor | .beans.XPropertySet | 地面のプロパティ設定 |
| Legend | .chart2.XLegend | 凡例の内容設定。 |
| DefaultColorScheme | .chart2.XColorScheme | デフォルトのチャート色系列管理。 |
| CoordinateSystems | [].chart2.XCoordinateSystem | チャートに描かれてる座標系。データは各座標系にあるチャートの種類ごとのデータ系列に所属。 |
| TitleObjet | .chart2.XTitle | メインタイトルオブジェクト。 |
ダイアグラムのプロパティ
※リファレンス未記載のものが多いので徐々に埋めていきます。
| 名前 | 型 | 説明 |
|---|---|---|
| ChartUserDefinedAttributes | com.sun.star.container.XNameContainer | ユーザー定義の属性 |
| ConnectBars | boolean | |
| D3DCameraGeometry | com.sun.star.drawing.CameraGeometry | |
| D3DSceneAmbientColor | long | |
| D3DSceneDistance | long | |
| D3DSceneFocalLength | long | |
| D3DSceneLightColor1 | long | |
| D3DSceneLightColor2 | long | |
| D3DSceneLightColor3 | long | |
| D3DSceneLightColor4 | long | |
| D3DSceneLightColor5 | long | |
| D3DSceneLightColor6 | long | |
| D3DSceneLightColor7 | long | |
| D3DSceneLightColor8 | long | |
| D3DSceneLightDirection1 | com.sun.star.drawing.Direction3D | |
| D3DSceneLightDirection2 | com.sun.star.drawing.Direction3D | |
| D3DSceneLightDirection3 | com.sun.star.drawing.Direction3D | |
| D3DSceneLightDirection4 | com.sun.star.drawing.Direction3D | |
| D3DSceneLightDirection5 | com.sun.star.drawing.Direction3D | |
| D3DSceneLightDirection6 | com.sun.star.drawing.Direction3D | |
| D3DSceneLightDirection7 | com.sun.star.drawing.Direction3D | |
| D3DSceneLightDirection8 | com.sun.star.drawing.Direction3D | |
| D3DSceneLightOn1 | boolean | |
| D3DSceneLightOn2 | boolean | |
| D3DSceneLightOn3 | boolean | |
| D3DSceneLightOn4 | boolean | |
| D3DSceneLightOn5 | boolean | |
| D3DSceneLightOn6 | boolean | |
| D3DSceneLightOn7 | boolean | |
| D3DSceneLightOn8 | boolean | |
| D3DScenePerspective | com.sun.star.drawing.ProjectionMode | |
| D3DSceneShadeMode | com.sun.star.drawing.ShadeMode | |
| D3DSceneShadowSlant | long | |
| D3DSceneTwoSidedLighting | boolean | |
| D3DTransformMatrix | com.sun.star.drawing.HomogenMatrix | |
| GroupBarsPerAxis | boolean | |
| IncludeHiddenCells | boolean | |
| MissingValueTreatment | long | |
| ParaUserDefinedAttributes | com.sun.star.container.XNameContainer | |
| Perspective | long | |
| PosSizeExcludeAxes | boolean | |
| RelativePosition | com.sun.star.chart2.RelativePosition | ダイアグラム部分のチャートサイズに対する比率での位置 |
| RelativeSize | com.sun.star.chart2.RelativeSize | ダイアグラム部分のチャートサイズに対する相対サイズ。 |
| RightAngledAxes | boolean | |
| RotationHorizontal | long | |
| RotationVertical | long | |
| SortByXValues | boolean | |
| StartingAngle | long | |
| TextUserDefinedAttributes | com.sun.star.container.XNameContainer | |
| UserDefinedAttributes | com.sun.star.container.XNameContainer |