<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?
- bar asked 5 years ago
- last edited 5 years ago
- You must login to post comments
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
- Andrew Burnett-Thompson answered 5 years ago
- You must login to post comments
Please login first to submit.