I know it is possible to create a dashed line annotation by using the StrokeDashArray property of a VerticalLineAnnotation or HorizontalLineAnnotation.
Is it possible to create a BoxAnnotation with a dashed border?
- Cole Bagshaw asked 7 months ago
-
Hi Cole, Thanks for your question. I am going to discuss it with our team and will get back to you as soon as I have an update. Kind regards, Lex, SciChart Technical Support Engineer
- You must login to post comments
Hi Cole,
I am sorry for the late response.
We discussed your inquiry.
SciChart BoxAnnotation uses WPF Border internally to display a Rectangle. So you should set appropriate BorderBrush on it to make a dashed border.
Please take a look:
<s:BoxAnnotation Background="Transparent"
BorderThickness="1"
CornerRadius="3"
X1="4"
X2="5.5"
Y1="4.5"
Y2="5.5">
<s:BoxAnnotation.BorderBrush>
<VisualBrush>
<VisualBrush.Visual>
<Rectangle StrokeDashArray="10 2" Stroke="Red" StrokeThickness="1" Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type Border}}, Path=ActualWidth}"
Height="{Binding RelativeSource={RelativeSource AncestorType={x:Type Border}}, Path=ActualHeight}"/>
</VisualBrush.Visual>
</VisualBrush>
</s:BoxAnnotation.BorderBrush>
</s:BoxAnnotation>
The code sample above results in the dashed border shown on the attached screenshot.
Hope this helps.
Kind regards,
Lex,
SciChart Technical Support Engineer
- Lex answered 7 months ago
- You must login to post comments
Please login first to submit.