SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, iOS Chart, Android Chart and JavaScript Chart Components

0 votes

To whom this may concern:

I’m having a slight issue (bug, possibly?) with custom annotations. I have created a custom annotation with an image (XAML shown below)

<s:CustomAnnotation x:Class="Dashboard.SciChartCustomComponents.CustomAnnotations.MicrostructureAnnotation"

    <Border BorderBrush="White" BorderThickness="2" Background="Black">
            <Image x:Name="annotationImage" Stretch="None" Width="150" Height="100" Visibility="Collapsed"/>
            <TextBlock x:Name="annotationText" HorizontalAlignment="Center"/>
            <TextBlock x:Name="parameterText" HorizontalAlignment="Center" Visibility="Collapsed"/>


The image is applied with the following code (note the anchor points are bottom-right):

var annotation = new MicrostructureAnnotation
    HorizontalAnchorPoint = HorizontalAnchorPoint.Right,
    VerticalAnchorPoint = VerticalAnchorPoint.Bottom,
    IsEditable = true,
    X1 = xValue, // Both Obtained from hitpoint X- and Y-Values
    Y1 = yValue

annotation.annotationImage.Source = // some image Uri
annotation.annotationText.Text = // some text
annotation.parameterText.Text = // some other text

So this successfully shows the annotation as i liked, shown in 1.png.

Now I have a function that collapses the visibility of the image, which yields an annotation that is removed from its anchor point (although the top-left location remains the same), shown in 2.png.

If I try to move the annotation after removing the image, the anchor point is in the location of where the top-left anchor should be when the image collapses but the image is still in the wrong location, shown in 3.png.

When I finally do move the annotation, the annotation moves away from the cursor to the top-left anchor point, shown in 4.png.

Again i’m not sure if this is a bug, but could someone please advise?

Thanks kindly!

— Ari

Edit: I don’t have this problem when setting the anchor points to top-left.

  • Ari Sagiv asked 5 years ago
  • last active 5 years ago
0 votes


I need to get the data positions of a text annotation’s anchor point. So if the Text annotation is anchored at vertical:center, horizontal:center and I want to get the HorizontalAnchor.Right’s position in the chart, how would I go about doing that?


Extra question: Is there a way to get the width of the TextAnnotation in coordinates?

  • kewur asked 6 years ago
  • last active 6 years ago
Showing 2 results
This template supports the sidebar's widgets. Add one or use Full Width layout.