Chartコントロールは注釈機能を提供します。注釈を使用すると、グラフ内に注釈テキストや注釈線を表示させて特定の項目や値を強調することができます。

グラフに注釈を設定する場合、以下のプロパティが重要となります。 
以下のサンプルコードは、実行時に注釈線と注釈テキストを作成し、それらを系列のAnnotationコレクションに追加する方法を示します。結果は上の図のようになります。 
Visual Basic
    
        
            
                
                    | Visual Basicコード | 
                    
                         
                            コードのコピー
                         
                     | 
                
                
                    | 
                         ' 注釈線と注釈テキストを作成します。 
                        Dim aLine1 As New GrapeCity.ActiveReports.Chart.Annotations.AnnotationLine 
                        Dim aLine2 As New GrapeCity.ActiveReports.Chart.Annotations.AnnotationLine 
                        Dim aText1 As New GrapeCity.ActiveReports.Chart.Annotations.AnnotationTextBar 
                        Dim aText2 As New GrapeCity.ActiveReports.Chart.Annotations.AnnotationTextBar 
                         
                        ' 各線と注釈テキストのプロパティを設定します。 
                        With aLine1 
                            .EndPoint = New GrapeCity.ActiveReports.Chart.Graphics.Point2d(1.5F, 30.0F) 
                            .Line = New GrapeCity.ActiveReports.Chart.Graphics.Line(System.Drawing.Color.Red, 2) 
                            .StartPoint = New GrapeCity.ActiveReports.Chart.Graphics.Point2d(1.5F, 15.0F) 
                        End With 
                        With aLine2 
                            .EndPoint = New GrapeCity.ActiveReports.Chart.Graphics.Point2d(4.6F, 47.0F) 
                            .Line = New GrapeCity.ActiveReports.Chart.Graphics.Line(System.Drawing.Color.Red, 2) 
                            .StartPoint = New GrapeCity.ActiveReports.Chart.Graphics.Point2d(3.6F, 45.0F) 
                        End With 
                        With aText1 
                            .AnchorPlacement = GrapeCity.ActiveReports.Chart.Annotations.AnchorPlacementType.Bottom 
                            .AnchorPoint = New GrapeCity.ActiveReports.Chart.Graphics.Point2d(1.5F, 31.0F) 
                            .Height = 25.0F 
                            .Line = New GrapeCity.ActiveReports.Chart.Graphics.Line(System.Drawing.Color.Red, 2) 
                            .Text = "Min Value" 
                            .Width = 100.0F 
                        End With 
                        With aText2 
                            .AnchorPlacement = GrapeCity.ActiveReports.Chart.Annotations.AnchorPlacementType.Left 
                            .AnchorPoint = New GrapeCity.ActiveReports.Chart.Graphics.Point2d(4.7F, 47.0F) 
                            .Height = 25.0F 
                            .Line = New GrapeCity.ActiveReports.Chart.Graphics.Line(System.Drawing.Color.Red, 2) 
                            .Text = "Max Value" 
                            .Width = 100.0F 
                        End With 
                         
                        ' 注釈線と注釈テキストを系列のAnnotationコレクションに追加します。 
                        Me.ChartControl1.Series(0).Annotations.AddRange( _ 
                            New GrapeCity.ActiveReports.Chart.Annotations.Annotation() {aLine1, aLine2, aText1, aText2}) 
                     | 
                
            
        
     
 
C#
    
        
            
                
                    | C#コード | 
                    
                         
                            コードのコピー
                         
                     | 
                
                
                    | 
                         // 注釈線と注釈テキストを作成します。 
                        GrapeCity.ActiveReports.Chart.Annotations.AnnotationLine aLine1 = 
                            new GrapeCity.ActiveReports.Chart.Annotations.AnnotationLine(); 
                        GrapeCity.ActiveReports.Chart.Annotations.AnnotationLine aLine2 = 
                            new GrapeCity.ActiveReports.Chart.Annotations.AnnotationLine(); 
                        GrapeCity.ActiveReports.Chart.Annotations.AnnotationTextBar aText1 = 
                            new GrapeCity.ActiveReports.Chart.Annotations.AnnotationTextBar(); 
                        GrapeCity.ActiveReports.Chart.Annotations.AnnotationTextBar aText2 = 
                            new GrapeCity.ActiveReports.Chart.Annotations.AnnotationTextBar(); 
                         
                        // 各線と注釈テキストのプロパティを設定します。 
                        aLine1.EndPoint = new GrapeCity.ActiveReports.Chart.Graphics.Point2d(1.5F, 30F); 
                        aLine1.Line = new GrapeCity.ActiveReports.Chart.Graphics.Line(System.Drawing.Color.Red, 2); 
                        aLine1.StartPoint = new GrapeCity.ActiveReports.Chart.Graphics.Point2d(1.5F, 15F); 
                        aLine2.EndPoint = new GrapeCity.ActiveReports.Chart.Graphics.Point2d(4.6F, 47F); 
                        aLine2.Line = new GrapeCity.ActiveReports.Chart.Graphics.Line(System.Drawing.Color.Red, 2); 
                        aLine2.StartPoint = new GrapeCity.ActiveReports.Chart.Graphics.Point2d(3.6F, 45F); 
                        aText1.AnchorPlacement = GrapeCity.ActiveReports.Chart.Annotations.AnchorPlacementType.Bottom; 
                        aText1.AnchorPoint = new GrapeCity.ActiveReports.Chart.Graphics.Point2d(1.5F, 31F); 
                        aText1.Height = 25F; 
                        aText1.Line = new GrapeCity.ActiveReports.Chart.Graphics.Line(System.Drawing.Color.Red, 2); 
                        aText1.Text = "Min Value"; 
                        aText1.Width = 100F; 
                        aText2.AnchorPlacement = GrapeCity.ActiveReports.Chart.Annotations.AnchorPlacementType.Left; 
                        aText2.AnchorPoint = new GrapeCity.ActiveReports.Chart.Graphics.Point2d(4.7F, 47F); 
                        aText2.Height = 25F; 
                        aText2.Line = new GrapeCity.ActiveReports.Chart.Graphics.Line(System.Drawing.Color.Red, 2); 
                        aText2.Text = "Max Value"; 
                        aText2.Width = 100F; 
                         
                        // 注釈線と注釈テキストを系列のAnnotationコレクションに追加します。 
                        this.chartControl1.Series[0].Annotations.AddRange( 
                            new GrapeCity.ActiveReports.Chart.Annotations.Annotation[] {aLine1, aLine2, aText1, aText2}); 
                     |