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

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy

We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

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.