Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
360
Chart sizing
posted

I am placing a chart on a container that's half the width of my 1680-width screen. The legend is clipped off.  If the panel is made wider (let's say the width of the display), the legend appears.

What do I have to do to force the legend to appear regardless of the width?

If your code allowed us to reposition the legend to the top or bottom of the chart, this wouldn't be an issue.

Parents
  • 30692
    Suggested Answer
    Offline posted

    Hi,

    I'm not sure why the Legend would be clipped unless you are explicitly setting the width fo the chart to wider than the container that holds it. Could you share the xaml, or show a sample that encapsulates the problem?

    As to displaying the Legend in different places, you can style the chart to experiment with different options in this regard. For example, this style would place the legend area on top of the chart:

     

    <Style x:Key="topLegend" TargetType="igChart:XamWebChart">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="igChart:XamWebChart">
                            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                                <Grid x:Name="RootElement" Background="{TemplateBinding Background}" Margin="{TemplateBinding Padding}" >
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="*"/>
                                    </Grid.RowDefinitions>
                                    <Grid x:Name="CaptionPanel" Grid.Row="0"/>
                                    <Grid x:Name="ScenePanel" Grid.Row="2"/>
                                    <Grid x:Name="LegendPanel" Grid.Row="1" MaxWidth="200"/>
                                </Grid>
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
    

    Let me know if this helps!

    -Graham

Reply Children