DropShadow对饼图的影响

时间:2012-07-01 08:19:38

标签: wpf toolkit

我想做一个带有DropShadow效果的饼图,所以我试图将效果放在PieDataPoint对象上,但它不起作用 - 而不是在每个切片的阴影中画出一个阴影他们对邻居的影子,如下图所示:

enter image description here

1 个答案:

答案 0 :(得分: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>