Pre loader

Dashed Border for Box Annotation

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

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?

Version
8.5.0.28148
  • Lex
    • Lex
    • 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 to post comments
1
0

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

Images
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.