Resolved MSChart. ChartType: Line, LineAnnotation drawing before the data of the line chart.

tim8w

Well-known member
Joined
Sep 8, 2020
Messages
141
Programming Experience
10+
I have a MSChart that is using CahertType of Line. After the Line Chart has been created, I add a LineAnnotation to display a line where the boss wants the goal to be and then add it to the Chart. When it displays, it flashes the Chart empty except for the LineAnnotation and then re-flashes the completed chart. Is there anyway to force the LineAnnotation to display only after the Line Chart has been built? I tried Invalidating the Line Chart after the data for the Chart is processed and then adding the LineAnnotation followed by another Invalidate. Everything I have tried results in the LineAnnotation being displayed first followed by a flash of the completed Chart.

LineAnnotation.png


LineChart.png


Any ideas?
 
Solution
I forgot to mention that my programs cycle through 4 different graphs and they are rebuilt each time. I forgot to remove the LineAnnotation from the Chart. When I did that, everything worked perfect. Sorry to bother people. Hopefully it will help somebody else. So now when it cycles to the next chart I "Clear" the Line Annotation.

chartMonthlyTrend.Annotations.Clear();
I forgot to mention that my programs cycle through 4 different graphs and they are rebuilt each time. I forgot to remove the LineAnnotation from the Chart. When I did that, everything worked perfect. Sorry to bother people. Hopefully it will help somebody else. So now when it cycles to the next chart I "Clear" the Line Annotation.

chartMonthlyTrend.Annotations.Clear();
 
Solution
Back
Top Bottom