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.
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
I'm creating the charts on the fly (without xaml), and the only constraint on the chart's size is the Border it's in, which is only setting padding and background color.
For what it's worth, the style you gave me didn't fix the problem. I still get no legend on the chart until I "maximixe" the container it's in.