1
私はSilverlight Control Toolkitを使用しており、チャートの下に凡例を配置しようとしています。 the question hereに基づいて、コントロールテンプレートを使用しようとしていますが、明らかに何かが欠けていて、グラフの代わりに何も表示されていません。任意の助けをいただければ幸いです。Silverlightチャートの下の凡例を下に移動ChartArea
<UserControl x:Class="ClientCenterControls.ReportView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:Controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
xmlns:project="clr-namespace:ClientCenterControls"
xmlns:model="clr-namespace:ClientCenterControls.Model"
mc:Ignorable="d"
d:DesignHeight="400" d:DesignWidth="600">
<UserControl.Resources>
<ControlTemplate x:Key="ChartLayoutBottom" TargetType="toolkit:Chart">
<Border>
<StackPanel Orientation="Vertical">
<toolkit:Title Grid.Row="0" Content="{TemplateBinding Title}" />
<toolkit:Legend x:Name="Legend" Header="{TemplateBinding LegendTitle}" Grid.Row="2" />
</StackPanel>
</Border>
</ControlTemplate>
</UserControl.Resources>
<Grid x:Name="LayoutRoot">
<Grid.Background>
<LinearGradientBrush EndPoint="0.5,1" MappingMode="RelativeToBoundingBox" StartPoint="0.5,0">
<GradientStop Color="Silver" />
<GradientStop Color="Gray" Offset="0.5"/>
<GradientStop Color="White" Offset="1"/>
</LinearGradientBrush>
</Grid.Background>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="350" />
<ColumnDefinition Width="250" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="25" />
<RowDefinition />
</Grid.RowDefinitions>
<sdk:Label x:Name="headerLabel" Content="Client Center CSA"
HorizontalAlignment="Center" Foreground="#444"
Grid.ColumnSpan="2" Grid.Row="0" Grid.Column="0" />
<Controls:DataGrid x:Name="gridDrivers" ItemsSource="{Binding Drivers}"
Grid.Row="1" Grid.Column="0">
</Controls:DataGrid>
<Controls:DataPager x:Name="dataPager1" Source="{Binding Drivers}"
Grid.Row="1" Grid.Column="0" PageSize="5" />
<toolkit:Chart x:Name="chartDrivers" Template="{StaticResource ChartLayoutBottom}"
Grid.Row="1" Grid.Column="1">
<toolkit:Chart.Series>
<toolkit:PieSeries
ItemsSource="{Binding Drivers}"
IndependentValueBinding="{Binding DriverIdentifier}"
DependentValueBinding="{Binding ScoreImpact}"
/>
</toolkit:Chart.Series>
</toolkit:Chart>
</Grid>
</UserControl>