Pre loader

Simple Watermark Question

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

Answered
1
0

I’m trying to place an image in the center of a graph but it isn’t positioning itself how I would expect, how do I correct this?

<Window x:Class="AnnoTest.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:s="http://schemas.abtsoftware.co.uk/scichart" 
    Title="MainWindow" Height="350" Width="525">
<Grid>
    <s:SciChartSurface x:Name="surface" s:ThemeManager.Theme="Chrome">
        <s:SciChartSurface.Resources>
            <DataTemplate x:Key="AnnotationTemplate">
                <Image Source="/AnnoTest;component/Images/SciChartLogo_Dark.png" />
            </DataTemplate>
        </s:SciChartSurface.Resources>

        <s:SciChartSurface.XAxis>
            <s:NumericAxis VisibleRange="0,100"/>
        </s:SciChartSurface.XAxis>
        <s:SciChartSurface.YAxis>
            <s:NumericAxis VisibleRange="-5,5"/>
        </s:SciChartSurface.YAxis>

        <s:SciChartSurface.Annotations>
            <s:CustomAnnotation
                    ContentTemplate="{StaticResource AnnotationTemplate}" 
                    HorizontalAnchorPoint="Center" 
                    VerticalAnchorPoint="Center"
                    AnnotationCanvas="BelowChart"
                    CoordinateMode="Relative"             
                    Opacity="0.50"           
                    X1="0.5"
                    Y1="0.5" />
            <s:TextAnnotation FontSize="24" Text="Annotations are Confusing!" CoordinateMode="Relative" X1="0.5" Y1="0.5" HorizontalAnchorPoint="Center" VerticalAnchorPoint="Center"/>
        </s:SciChartSurface.Annotations>


    </s:SciChartSurface>
</Grid>

  • You must to post comments
Best Answer
0
0

UPDATE: A bug where CustomAnnotation did not position itself if ContentTemplate was set is now fixed in build v3.3.3.6281, available from our nightly build page.

Hi Matt,

We believe this is a bug. We took your code and pasted it into the designer, and did reproduce your issue where the annotation docks to the top-left (not centre).

Then I played around with it a bit and cut the annotation, pasted it back, cut it, pasted it back, re-arranged some properties, and suddenly got this (attached image)

So your code is correct, its just not working as expected. We will investigate and attempt to fix.

Apologies for the ‘confusion’ !

Best regards,
Andrew

Images
  • You must to post comments
0
0

Thanks much, will update now!

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies