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


Hi guys,

I have a custom Modifier on my SciChart which will function by allowing a user to click and drag a symbol (an Ellipse, for argument’s sake) along the XAxis (just below the labels). Dragging this will move a verticle line drawn on the Modifier Surface to be positioned above the symbol. Bindings on where the symbol (and line) are located will be used in the VM for ends not relevant to this question ­čÖé

So, I can handle drawing the vertical line on the ModifierSurface just fine – but I cannot seem to add the Ellipse underneath the XAxis. I have increased the height of the XAxis so there is room for it, but it’s just the drawing that is painful.

Could I get a helping hand? ­čÖé


  • You must to post comments
Best Answer

Hi again,

Regarding my suggestion, it allows you to avoid drawing on the ModifierAxisCanvas in your modifier. You could add something like this:

                <s:VerticalLineAnnotation VerticalAlignment="Stretch"
                                          . . .
                        <Style x:Key="labelStyle" TargetType="s:AnnotationLabel">
                            <Setter Property="Template">
                                    <ControlTemplate TargetType="s:AnnotationLabel">
                                            <!-- Triangular marker -->
                                            <Path Fill="{Binding Stroke}">
                                                    <PathGeometry Figures="M7.5625,0 L-0.4995,15.4375 15.438,15.561996 z" FillRule="NonZero" />

                                            <TextBox x:Name="PART_InputTextArea" Visibility="Collapsed" />
                    <s:AnnotationLabel AxisLabelStyle="{StaticResource labelStyle}" />

Concerning the second issue, it is easy to achieve by modifying the SciChart template in Themes. Unfortunately, I can’t realize how to do that in another way (maybe inheriting the SciChartSurface and overriding its OnApplyTemplate method and changing VisualTree manually inside). But there is a workaround: you could draw ticks with a longer length (need to set the MajorTickLineStyle, MinorTickLineStyle properties, style’s TargetType is Line).

If there are another ideas how to manage it, I’ll get back to you.

Best regards,

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.