silverlight 饼图 单机 显示详细信息

时间:2021-12-04 11:20:12

 

 

 

 

 

 

饼图:直接贴代码

<StackPanel Height="55" HorizontalAlignment="Left" Margin="12,5,0,0" Name="stackPanel1" VerticalAlignment="Top" Width="122" >
    <TextBlock Text="选择的信息" FontWeight="Bold"/>
    <StackPanel Orientation="Horizontal">
        <TextBlock Text="错误码: "/>
        <TextBlock Text="{Binding frequencyCellName}"/>
    </StackPanel>
    <StackPanel Orientation="Horizontal">
        <TextBlock Text="比例: "/>
        <TextBlock Text="{Binding sRate}"/>
    </StackPanel>
</StackPanel>

 

series.IsSelectionEnabled = true;
series.SelectionChanged += new SelectionChangedEventHandler(pie_SelectChanged);

 

private void pie_SelectChanged(object sender, SelectionChangedEventArgs e)
{
    stackPanel1.DataContext = (1 <= e.AddedItems.Count) ? e.AddedItems[0] : null;
}

 

silverlight 饼图 单机 显示详细信息