2011/03/31

チャート: タイトルの設定 (Chart titles)

チャート内のタイトルの設定についてまとめます。
GUIからも一定の設定が可能ですが、XMLを直接操作することで、より細かい設定が可能です。

Title、Subtitle、および Footnote には以下の属性が定義されています。
  • text
  • visible (true | false)
  • fontSizeAbsolute (true | false)
  • horizontalAlignment (LEFT | CENTER | RIGHT)
  • verticalAlignment (TOP | CENTER | BOTTOM)
  • textRotation (TR_HORIZ | TR_HORIZ_ROTATE_90 | TR_HORIZ_ROTATE_270 )

また、軸タイトルを設定する O1Title、X1Title、Y1Title、Y2Title、ZTitle には上記の属性に加え、以下の属性が定義されています。
  • wordWrapEnabled (true | false)

以下にサンプルコードと実行結果を示します。
<Title    visible="true" text="(1) Title" />
<Subtitle visible="true" text="(2) Subtitle" />
<Footnote visible="true" text="(3) Footnote" />
<O1Title  visible="true" text="(4) O1 Axis Title" />
<Y1Title  visible="true" text="(5) Y1 Axis Title" />


文字スタイルの指定は GraphFont にて行います。以下の例では Title に文字スタイルの設定を行います。他のタイトル要素も同様の書式で設定できます。
<Title text="(1) Title" visible="true">
  <GraphFont size="14" bold="true" fontColor="#FF0000"/>
</Title>




[ Summary ]
BI Publisher provides Title, Subtitle and Footnote elements. The attributes are listed above.
In addition, O1Title, X1Title, Y1Title, Y2Title, and ZTitle are defined for the axises. The axis titles support wordWrapEnabled additionally.  The result of the source code below is shown in the first figure.

<Title    visible="true" text="(1) Title" />
<Subtitle visible="true" text="(2) Subtitle" />
<Footnote visible="true" text="(3) Footnote" />
<O1Title  visible="true" text="(4) O1 Axis Title" />
<Y1Title  visible="true" text="(5) Y1 Axis Title" />




You can specify font and style with GraphFont.  The result of the following code is shown in the second figure.

<Title text="(1) Title" visible="true">
  <GraphFont size="14" bold="true" fontColor="#FF0000"/>
</Title>



0 件のコメント:

コメントを投稿