당신은 주석
을 사용할 수 있습니다
double avg = Chart1.Series[0].Points.Average(p => p.XValue);
double lineHeight = avg;
HorizontalLineAnnotation ann = new HorizontalLineAnnotation();
ann.AxisX = Chart1.ChartAreas[0].AxisX;
ann.AxisY = Chart1.ChartAreas[0].AxisY;
ann.IsSizeAlwaysRelative = false;
ann.AnchorY = lineHeight;
ann.IsInfinitive = true;
ann.ClipToChartArea = Chart1.ChartAreas[0].Name; ann.LineColor = Color.Red; ann.LineWidth = 3;
Chart1.Annotations.Add(ann);
HTML 코드 텍스트 주석에 대한
<asp:Chart runat="server" ID="Chart1" ImageStorageMode="UseImageLocation" Width="800px" Height="400px" OnClick="Chart1_Click">
<ChartAreas >
<asp:ChartArea></asp:ChartArea>
</ChartAreas>
<series>
<asp:Series Name="Students" BorderColor="180, 26, 59, 105">
<Points>
<asp:DataPoint AxisLabel="jon" XValue="5" YValues="4" />
<asp:DataPoint AxisLabel="kon" XValue="15" YValues="44" />
<asp:DataPoint AxisLabel="pol" XValue="85" YValues="90" />
</Points>
</asp:Series>
</series>
</asp:Chart>
코드
TextAnnotation txtAnn = new TextAnnotation();
txtAnn.AxisX = Chart1.ChartAreas[0].AxisX;
txtAnn.AxisY = Chart1.ChartAreas[0].AxisY;
txtAnn.IsSizeAlwaysRelative = false;
txtAnn.AnchorY = lineHeight;
txtAnn.AnchorX = Chart1.Series[0].Points.Last().XValue;
txtAnn.AnchorAlignment = ContentAlignment.BottomLeft;
txtAnn.Text = "DivisionOne(35.5)";
txtAnn.ClipToChartArea = Chart1.ChartAreas[0].Name; txtAnn.ForeColor = Color.Red;
Chart1.Annotations.Add(txtAnn);
당신은 더 많은 정보 흐름을 얻을 수 있습니다 이온 여기
More Information About Annotations
Chart Image
내가보기에 ... StripLines의 경우 Z- 순서가 표시됩니다. 프로그래밍 방식으로 결정됩니다. "StripLine 개체의 Z 순서는 StripLinesCollection 개체의 발생 순서에 따라 결정됩니다. 즉, 첫 번째 발생이 먼저 표시됩니다. 두 번째 발생은 두 번째 등으로 표시됩니다. " 차트 영역 뒤에 항상있는 별도의 순서가 있다고 생각합니다. – tedski