Mick Posted April 7, 2010 Report Share Posted April 7, 2010 How do I force the layout of the legend on a chart to be horizontal / vertical (XAML and code)? I tried using the template here, but I wasn't sure where to apply it: http://community.softwarefx.com/forums/p/8999/27125.aspx#27125 Thank you, Mick Quote Link to comment Share on other sites More sharing options...
RandyJ Posted April 7, 2010 Report Share Posted April 7, 2010 Hi, Please take a look at the code below. It shows where to apply the template you need: <my:Chart Margin="13,13,13,5" Name="chart1"> <my:Chart.LegendBox> <my:LegendBox Visibility="Visible" DockPanel.Dock="Right"> <my:LegendBox.ContainerStyle> <Style TargetType="{x:Type ItemsControl}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate> <StackPanel Orientation="Horizontal" IsItemsHost="True"/> </ControlTemplate> </Setter.Value> </Setter> </Style> </my:LegendBox.ContainerStyle> </my:LegendBox> </my:Chart.LegendBox> </my:Chart> Regards, Randy Jimenez Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.