FlexChart for UWP
注釈の追加
FlexChart > FlexChart の操作 > FlexChart の要素 > 注釈 > 注釈の追加

FlexChart では、注釈レイヤに注釈を追加できます。注釈レイヤには、チャート内のすべての注釈のコレクションが含まれます。

FlexChart に注釈を追加するには、次の手順に従います。

  1. FlexChart で注釈レイヤを作成します。
  2. 注釈レイヤに注釈インスタンスを追加します。

FlexChart で注釈レイヤを作成するには、AnnotationLayerクラスのインスタンスを作成し、それをFlexChartの Layersコレクションに追加します。注釈レイヤに注釈を追加するには、注釈のタイプに対応する注釈クラスのインスタンスを作成します。その注釈インスタンスを注釈レイヤの Annotations コレクションに追加します。

次のコードスニペットは、FlexChart で四角形注釈を作成し、それを注釈レイヤに追加する方法を示します。

<Chart:C1FlexChart.Layers>
    <Annotation:AnnotationLayer>
        <Annotation:AnnotationLayer.Annotations>
            <Annotation:Rectangle Content="最大税収&#13;2013&#13;45000">
            </Annotation:Rectangle>
        </Annotation:AnnotationLayer.Annotations>
    </Annotation:AnnotationLayer>
</Chart:C1FlexChart.Layers>