Annotation does not display on asp.net chart control

I have a chart control in asp.net that I am trying to display annotation in the chart area - topcenter of 'ChartArea1'.  It does not display on the chart.

Why?

Below is my asp.net code

<Annotations>
                                        
                                            <asp:TextAnnotation Alignment="TopCenter" Font="Arial, 10pt" ForeColor="#00FFCC"
                                                Name="Chart1Annotation" Text="Nominal" TextStyle="Default" ClipToChartArea="ChartArea1">
                                            </asp:TextAnnotation>
                                        </Annotations>

Open in new window

rckrchAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Julian HansenCommented:
Not much to go on - can you give us a link to the code or if unable post your rendered HTML.
gr8gonzoConsultantCommented:
You don't show the code where you've attached the annotation to the chart itself. I see the "ClipToChartArea" but that's not enough to associate the annotation with the chart.

Your Chart object should have an Annotations collection - the code you showed looks like it might be that annotations collection, but there's not enough to see that for sure.
rckrchAuthor Commented:
Thanks for the response!

This is the code behind as well.  The ASP.Net code I sent earlier and this code behind are what I have for this annotation.

Thanks,

Chart1.Annotations.Clear()
        Dim Chart1Annot As New DataVisualization.Charting.TextAnnotation 
        Chart1.Annotations.Add(Chart1Annot)
        Chart1Annot.ForeColor = Color.Coral
        Chart1Annot.Font = New Font("Arial", 10)
        Chart1.Annotations.
        'Chart1Annot = Chart1.Annotations.FindByName("Chart1Annotation")
        Chart1Annot.Text = "Nom: " & Nominal11.Text & " High: " & High11.Text & " Low: " & Low11.Text
        Chart1Annot.BringToFront()

Open in new window

Your Guide to Achieving IT Business Success

The IT Service Excellence Tool Kit has best practices to keep your clients happy and business booming. Inside, you’ll find everything you need to increase client satisfaction and retention, become more competitive, and increase your overall success.

gr8gonzoConsultantCommented:
On line 6, you seem to have some broken code:
Chart1.Annotations.

Open in new window

rckrchAuthor Commented:
Thanks gr8gonzo,

I took that line out and I still have no annotation on the chart.
gr8gonzoConsultantCommented:
I'm a little curious how that line didn't throw an exception. If you are looking at this code in visual studio, then VS should tell you about it. I would suggest putting that line back in temporarily, and then checking it with visual studio to make sure it is showing up as an error. If it isn't, then something is wrong with your VS setup. If that's the case, then there might be other errors that might be leading to the annotation code not being executed correctly.
rckrchAuthor Commented:
I had been trying different lines to resolve the issue and this was part of a line that was edited before I loaded on Experts exchange.  It did show an error after I had edited it and inadvertently didn't delete the line.  It was not intended to be part of the code the way it was written.  the intelisense did detect the incomplete code.  

Should this code work as written - if it should it is still not working.  Should this be part of the triggers in the update panel?

Thanks,
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.