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
- Lucas Fiévet asked 6 years ago
- You must login to post comments
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.
- Lucas Fiévet answered 6 years ago
- You must login to post comments
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.
- Oleksandr Shvets answered 6 years ago
- You must login to post comments
Please login first to submit.