Pre loader

Memory usage (part 2)

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

0
0

Hello again!
In addition to the ticket https://www.scichart.com/questions/question/memory-usage-1

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.
Link: https://yadi.sk/d/TSsZuDTbipP7y

  • You must to post comments
0
0

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">
        <s:BoxAnnotation.Template>
            <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}"/>
                </Border> 
            </ControlTemplate>
        </s:BoxAnnotation.Template>
    </s:BoxAnnotation>

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

Best regards,
Andrew

  • 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