Pre loader

How to control height/width of legend after -90 degree rotation.

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

1
0

I am working with the OilAndGasExample solution from the customer examples. I want to take all the charts in the vertical chart section and display them horizontally. I am having a problem with the legends, which must be displayed on their side. As an example, I have added a RenderTransform to the resistivity legend, which provides the proper orientation. My problem is that the width and height no longer match the space allotted next to the chart. I assume I have to reverse how the width and height are bound. How do I do that?

<Grid x:Key="ResistivityChartAxisLegend" Style="{StaticResource AxisLegendGridStyle}" RenderTransformOrigin="0.5,0.5">
    <Grid.RenderTransform>
        <RotateTransform Angle="-90"/>
    </Grid.RenderTransform>
    <Grid.RowDefinitions>
        <RowDefinition Height="*"/>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="20"/>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="20"/>
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="*"/>
        <ColumnDefinition Width="*"/>
    </Grid.ColumnDefinitions>

    <Line Grid.Row="1" Grid.ColumnSpan="2" Stroke="OrangeRed" X1="0" X2="1" Stretch="Fill" StrokeThickness="1" StrokeDashArray="5,5"/>

    <TextBlock Grid.Row="2" Grid.Column="0" Text="0" HorizontalAlignment="Left" Style="{StaticResource AxisLegendTextBlockStyle}"/>
    <TextBlock Grid.Row="2" Grid.ColumnSpan="2" Text="AVRG 40" HorizontalAlignment="Center" Style="{StaticResource AxisLegendTextBlockStyle}"/>
    <TextBlock Grid.Row="2" Grid.Column="1" Text="1" HorizontalAlignment="Right" Style="{StaticResource AxisLegendTextBlockStyle}"/>

    <Line Grid.Row="3" Grid.ColumnSpan="2" Stroke="DeepSkyBlue" X1="0" X2="1" Stretch="Fill" StrokeThickness="2"/>

    <TextBlock Grid.Row="4" Grid.Column="0" Text="0" HorizontalAlignment="Left" Style="{StaticResource AxisLegendTextBlockStyle}"/>
    <TextBlock Grid.Row="4" Grid.ColumnSpan="2" Text="RESISTIVITY" HorizontalAlignment="Center" Style="{StaticResource AxisLegendTextBlockStyle}"/>
    <TextBlock Grid.Row="4" Grid.Column="1" Text="1" HorizontalAlignment="Right" Style="{StaticResource AxisLegendTextBlockStyle}"/>
</Grid>
Version
8.9.0.28766
Images
  • You must to post comments
0
0

Hi Stephen,

Thank you for your inquiry.
Please accept my apologies for such a delayed response.

We reviewed the provided details, and it appears to be a purely WPF question. You need to change the layout to achieve the desired appearance.
Unfortunately, as this doesn’t directly involve customizing SciChart controls, your inquiry falls outside our support scope.

Thank you for your understanding.

Kind regards,
Lex S., MSEE
SciChart Technical Support Engineer

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.