我想做一个带有 DropShadow 效果的饼图,所以我尝试将效果放在 PieDataPoint 对象上,但它不起作用 - 而不是在饼图的每个切片上绘制自己的阴影它的邻居,如下图所示:
问问题
486 次
1 回答
0
最终,我在图表模板内的 EdgePanel 上设置了 DropShadow 效果,它起作用了。
<Charting:Chart.Template>
<ControlTemplate TargetType="Charting:Chart">
<Border>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<chartingprimitives:EdgePanel x:Name="ChartArea" Style="{TemplateBinding ChartAreaStyle}">
<chartingprimitives:EdgePanel.Effect>
<DropShadowEffect
ShadowDepth = "5"
Direction = "330"
Color = "Gray"
Opacity = "0.5"
BlurRadius = "10">
</DropShadowEffect>
</chartingprimitives:EdgePanel.Effect>
</chartingprimitives:EdgePanel>
<charting:Legend x:Name="Legend" BorderThickness="0" Grid.Row="1" HorizontalAlignment="Center"/>
</Grid>
</Border>
</ControlTemplate>
</Charting:Chart.Template>
于 2012-07-02T10:52:05.267 回答