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

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy. We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

Please note: SciChart team will only answer questions from customers with active support subscriptions. Expired support questions will be ignored. If your support status shows incorrectly, contact us and we will be glad to help.

Answered
1
0

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? đŸ™‚

Thanks,
Miles

  • You must to post comments
Best Answer
1
0

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"
                                          . . .
                                          IsEditable="True">
                    <s:VerticalLineAnnotation.Resources>
                        <Style x:Key="labelStyle" TargetType="s:AnnotationLabel">
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate TargetType="s:AnnotationLabel">
                                        <Grid>
                                            <!-- Triangular marker -->
                                            <Path Fill="{Binding Stroke}">
                                                <Path.Data>
                                                    <PathGeometry Figures="M7.5625,0 L-0.4995,15.4375 15.438,15.561996 z" FillRule="NonZero" />
                                                </Path.Data>
                                            </Path>

                                            <TextBox x:Name="PART_InputTextArea" Visibility="Collapsed" />
                                        </Grid>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                        </Style>
                    </s:VerticalLineAnnotation.Resources>
                    <s:AnnotationLabel AxisLabelStyle="{StaticResource labelStyle}" />
                </s:VerticalLineAnnotation>

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,
Yuriy

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.