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

0
0
      <s:SciChartSurface.Annotations>
            <s:BoxAnnotation X1="25" X2="75" Y1="0" Y2="100" Background="#33FFFFFF" 
                BorderBrush="#55FFFFFF" BorderThickness="3" Padding="5">

                <s:BoxAnnotation.Template>

                    <ControlTemplate TargetType="s:BoxAnnotation">


                        <Border x:Name="PART_BoxAnnotationRoot" 
           Margin="{TemplateBinding Margin}"
           Background="{TemplateBinding Background}"
           BorderBrush="{TemplateBinding BorderBrush}"
           BorderThickness="{TemplateBinding BorderThickness}"
           CornerRadius="{TemplateBinding CornerRadius}">
                            <Viewbox Margin="{TemplateBinding Padding}" >
                                <TextBlock Text="Hello CustomAnnotation World!"></TextBlock>

                            </Viewbox>
                        </Border>

                    </ControlTemplate>
                </s:BoxAnnotation.Template>
            </s:BoxAnnotation>
        </s:SciChartSurface.Annotations>

by below tag or a code?

Version
last
  • You must to post comments
0
0

Im not sure I understand the question.

To put an image inside an annotation, you simply change the control template to contain an image.

<s:SciChartSurface.Annotations>
      <s:BoxAnnotation X1="25" X2="75" Y1="0" Y2="100" >

          <s:BoxAnnotation.Template>

              <ControlTemplate TargetType="s:BoxAnnotation">


                  <Border x:Name="PART_BoxAnnotationRoot"
     Margin="{TemplateBinding Margin}"
     Background="{TemplateBinding Background}"
     BorderBrush="{TemplateBinding BorderBrush}"
     BorderThickness="{TemplateBinding BorderThickness}"
     CornerRadius="{TemplateBinding CornerRadius}">
                      <Image source="YOUR IMAGE SOURE"/>
                  </Border>

              </ControlTemplate>
          </s:BoxAnnotation.Template>
      </s:BoxAnnotation>
  </s:SciChartSurface.Annotations>

We have an example here https://support.scichart.com/index.php?/Knowledgebase/Article/View/17209/33/custom-annotations—adding-a-watermark-to-a-chart

Best regards,
Andrew

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.