Pre loader

GroupBox/Annotation in top right corner of chart

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

Dear support,

What is the best way to anchor a GroupBox to the top right corner of a SciChartSurface (as shown in the attached screenshot)? At the moment, I am using an absolute positioning that often fails at initialization or when the surface is resized. I am looking into the annotation API, but have not yet found a clean solution.

Thank you,
Lucas

Version
5.4.0.12119
Images
  • You must to post comments
0
0

I now got something working like this:

<s:SciChartSurface.Annotations>
    <s:CustomAnnotation
        HorizontalAnchorPoint="Right"
        VerticalAnchorPoint="Top"
        CoordinateMode="Relative"
        X1="0.98"
        Y1="0.5"
        AnnotationCanvas="AboveChart">
        <s:CustomAnnotation.Template>
            <ControlTemplate>
                <GroupBox Header="Parameters">
                    <DataGrid
                        BorderThickness="0"
                        BorderBrush="Transparent"
                        ItemsSource="{Binding Params}"
                        GridLinesVisibility="None"
                        HeadersVisibility="None"
                        AutoGenerateColumns="False">
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding Name}" IsReadOnly="True" />
                            <DataGridTextColumn Binding="{Binding ValueString}" IsReadOnly="True" />
                        </DataGrid.Columns>
                    </DataGrid>
                </GroupBox>
            </ControlTemplate>
        </s:CustomAnnotation.Template>
    </s:CustomAnnotation>
</s:SciChartSurface.Annotations>

However, I do not manage to position the annotation at the bottom right. The “Y1” attribute seems to have no effect.

  • You must to post comments
0
0

Hi Lucas,

Thanks for your inquiry. I am sorry for the late reply.

In the case of CoordinateMode=”Relative”, the starting point (0,0) for the coordinate calculation is the top left corner of the SciChartSurface. Please take a look at our documentation page regarding Coordinates for more info:
https://www.scichart.com/documentation/v5.x/webframe.html#Axis%20APIs%20-%20Convert%20Pixel%20to%20Data%20Coordinates.html

To place the Annotation at the bottom right of the SciChartSurface you have to set Annotation.VerticalAnchorPoint property to Buttom, Annotation.HorizontalAnchorPoint to Right and both X1, Y1 coordinates to the values of 1 or close to it.

Please let me know if this helps.

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies