locked
Annotation RRS feed

  • Question

  • Hi

    I added a annotation to chart the chart and I only see it at design time, is thier any propertie that needs to be set?

    Thanks
    Itzik
    Thursday, November 6, 2008 4:08 PM

Answers

  • You also need to set the location of the annotation:

    lineAnnotation1.X = 30;  
    lineAnnotation1.Y = 40; 

    By default it is in chart relative coordinate system where top left corner is 0,0 and bottom right is 100,100. You can also associate your annotation with the axis coordinate system and use axis values to position your axis. 

    I recommend downloading chart samples, where you can find answers to many questions: http://code.msdn.microsoft.com/mschart

    Alex.
    Sunday, November 9, 2008 6:17 PM

All replies

  • My guess, you didn't specify annotation Width and Height. At design-time annotation is always visible even if it's size in not specified. You do not need to specify the size of the annotations like Text, which support automatic resizing based o the content.

    Alex.
    Thursday, November 6, 2008 4:30 PM
  •  This is my code
    lineAnnotation1.ClipToChartArea = "ChartArea1";  
    lineAnnotation1.Height = 50;  
    lineAnnotation1.IsSizeAlwaysRelative = false;  
    lineAnnotation1.LineColor = System.Drawing.Color.DarkRed;  
    lineAnnotation1.LineWidth = 10;  
    lineAnnotation1.Name = "LineAnnotation2";  
    lineAnnotation1.Width = 21

    any other idea?

    Thanks
    Itzik
    Sunday, November 9, 2008 7:37 AM
  • You also need to set the location of the annotation:

    lineAnnotation1.X = 30;  
    lineAnnotation1.Y = 40; 

    By default it is in chart relative coordinate system where top left corner is 0,0 and bottom right is 100,100. You can also associate your annotation with the axis coordinate system and use axis values to position your axis. 

    I recommend downloading chart samples, where you can find answers to many questions: http://code.msdn.microsoft.com/mschart

    Alex.
    Sunday, November 9, 2008 6:17 PM
  • Thanks, It solved my problem

    About the code sample, The code (from the exe) in the sample "Free-drawing Annotations" is wrong and dosn't work (the code in the project works fine)

    Thanks again
    Itzik
    Monday, November 10, 2008 10:53 AM
  • We will look into that and fix the sample code...

    Alex.
    Monday, November 10, 2008 10:59 PM
  • I'd like to anchor a callout annotation to the top right hand corner of the chart view area, and have it remain anchored to that point regardless of zooming, scaling, scrolling or changes in the size of the control. Is there an easy way to do this?  The closest I can get is to use AnchorX and AnchorY but they seem to be set relative to the chart coordinate system and the anchor point doesn't hold precisely to the chart area if the control is resized.

     

     

    Sunday, March 21, 2010 8:47 PM
  • Alex, the error consists on the sample code missing: polyline.AllowPathEditing = True

    Tuesday, May 4, 2010 6:21 PM