When using Fastlines, annotations do not show up in the Chart
(Whatever the nature of the annotation)
This is very annoying and I've read through the MSDN on the subject, there is no trace of such a restriction.
If anybody can confirm that freak/buggy behavior and offer some workaround, he's very welcome.
The only ugly trick i've found is to plot a duplicate transparent line and anchor the annotations to its points.. At least, I hope this post will avoid other developers screwing their nights on this.
The more I use MS Chart Control (Ex-Dundas) the more I'm getting used to dirty hacks like these.
Just one among too many night/sleep/life spoiler for developers.
EDIT :
To asnwer a code sample request :
System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
series1.ChartArea = myChartArea.Name;
series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.FastLine;
series1.Legend = "Default";
series1.Name = "Series1";
this.chart.Series.Add(series1);
Random random = new Random();
for (int pointIndex = 0; pointIndex < 10; pointIndex++)
series1.Points.AddXY(DateTime.Now.AddHours(pointIndex), random.Next(5, 60));
RectangleAnnotation annotation = new RectangleAnnotation();
annotation.AnchorDataPoint = series1.Points[1];
annotation.Text = "Just Won't Work";
annotation.ForeColor = Color.Black;
annotation.Font = new Font("Arial", 12); ;
annotation.LineWidth = 2;
chart.Annotations.Add(annotation);