Pre loader

Memory usage (part 2)


Hello again!
In addition to the ticket

I’ve modified my project to run faster. I’ve put BackgroundImageAnnotation, from which we create sprite, outside the function. But when I run the application, the image freezes and doesn’t redraw.
What is the reason? And how can I fix it?

I’ve attached modified project below.

  • You must to post comments

Hi Egor,

CustomAnnotation is designed to show an annotation with a single X,Y point and requires that you set the Width and Height.

Alternatively, if you want an annotation to cover the whole chart you can use BoxAnnotation and set its Template, as follows:

    <s:BoxAnnotation X1="0" X2="1" Y1="0" Y2="1" CoordinateMode="Relative" AnnotationCanvas="BelowChart">
            <ControlTemplate TargetType="s:BoxAnnotation">
               <Border x:Name="PART_BoxAnnotationRoot" BorderBrush="Transparent" BorderThickness="0" Background="Transparent">
                    <!-- Assuming DataContext has ImageSource dependency property -->
                    <Image Source="{Binding Path=ImageSource,ElementName=BackgroundImage}"/>

That will stretch the BoxAnnotation over the entire chart surface, and automatically resize as the chart resizes.

Best regards,

  • You must to post comments
Showing 1 result
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