开发者

MSCHART Line graph annotation position

开发者 https://www.devze.com 2023-02-19 00:48 出处:网络
Im wondering if anyone could help me with annotations im using in my MShart control. I have a line chart, at certain data plots within this chart I have annotations.

Im wondering if anyone could help me with annotations im using in my MShart control. I have a line chart, at certain data plots within this chart I have annotations.

RactangleAnnotation a = new RectangleA开发者_如何学Pythonnnotation();
a.AnchorDataPoint = chart.Series["series1"].Points[i];

This places the annotation on my linechart at the position the data value is. What I need is to display this annotation, possibly at the top of my chart, and draw a line from myh annotation to the dataValue.

Is this possible?


You can get at the paint events in the Chart Control and use the DrawLine function. Here's how to get at the paint events:

http://weblogs.asp.net/stevewellens/archive/2008/12/03/custom-annotate-your-charts.aspx


You might also want to take a look at the CalloutAnnotation. It provides a text entry area and draws an arrow to your data point. Here's an link to the sample files:

http://archive.msdn.microsoft.com/mschart/Release/ProjectReleases.aspx?ReleaseId=4418

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号