none
MS Charts image annotation anchor to data points

    Question

  • I  use MSDN charts to represent real time data. i have anchored images to particulate data points.when data update i want annotations to move back with data points. 

     ImageAnnotation img= new ImageAnnotation();
    img.AnchorDataPoint = chart1.Series["Series1"].Points[i];
    img.Image = "img.png";
    img.AnchorAlignment = ContentAlignment.TopCenter;
    img.AnchorOffsetY = 1;

    chart1.Annotations.Add(img);


    Friday, April 28, 2017 9:11 AM

All replies

  • Hi Abey19,

    Thank you for posting here.

    For your question, please try the following code.

         ImageAnnotation img = new ImageAnnotation();
                img.X = 5;
                img.Y = 5;
                img.AllowMoving = true;
                img.Image = @"C:\Users\v-wezan\Desktop\Qimage\1.png";
                chart1.Annotations.Add(img);

    You could move the image to the place which you like.

    I hope this would be helpful.

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, May 4, 2017 6:26 AM
    Moderator