首页 新闻 会员 周边 捐助

WPF DevExpress 饼状图控件放在Popup中程序运行报错

0
[待解决问题]

xaml代码如下:

<Window xmlns:dxc="http://schemas.devexpress.com/winfx/2008/xaml/charts" x:Class="PopupControl.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid>
<Popup Name="TitlePopue" AllowsTransparency="True" IsOpen="True" ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollBarVisibility="Hidden"
>
<dxc:ChartControl Name="chartPie"
AnimationMode="OnLoad"
BorderThickness="0"
EnableAnimation="True"
ToolTipEnabled="True"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
Background="{x:Null}">
<!--<dxc:ChartControl.Titles>
<dxc:Title Dock="Top" HorizontalAlignment="Center" FontSize="10">Area of Countries</dxc:Title>
</dxc:ChartControl.Titles>-->
<dxc:SimpleDiagram2D>
<dxc:SimpleDiagram2D.Series>
<dxc:PieSeries2D x:Name="Series" ArgumentScaleType="Qualitative" AnimationAutoStartMode="SetStartState"
HoleRadiusPercent="10"
Rotation="0"
SweepDirection="Clockwise"
>
<dxc:PieSeries2D.PointAnimation>
<dxc:Pie2DFlyInAnimation Duration="0:0:1.5" PointOrder="Random" />
</dxc:PieSeries2D.PointAnimation>
<dxc:PieSeries2D.PointOptions>
<dxc:PointOptions PointView="ArgumentAndValues">
<dxc:PointOptions.ValueNumericOptions>
<dxc:NumericOptions Format="Percent" Precision="0" />
</dxc:PointOptions.ValueNumericOptions>
</dxc:PointOptions>
</dxc:PieSeries2D.PointOptions>
<dxc:PieSeries2D.Label>
<dxc:SeriesLabel Visible="True"
dxc:PieSeries.LabelPosition="Inside"
RenderMode="RectangleConnectedToCenter" />
</dxc:PieSeries2D.Label>
<dxc:PieSeries2D.Points>
<dxc:SeriesPoint Argument="网络攻击" Value="9" />
<dxc:SeriesPoint Argument="病毒感染" Value="9" />
<dxc:SeriesPoint Argument="安全漏洞" Value="17" />
</dxc:PieSeries2D.Points>
</dxc:PieSeries2D>
</dxc:SimpleDiagram2D.Series>
</dxc:SimpleDiagram2D>
</dxc:ChartControl>
</Popup>
</Grid>
</Window>

 

cs代码:

chartPie.Animate();

 

报错信息:

“System.NullReferenceException”类型的未经处理的异常在 PresentationFramework.dll 中发生

其他信息: 未将对象引用设置到对象的实例。

wangmeng_xm的主页 wangmeng_xm | 初学一级 | 园豆:189
提问于:2016-11-17 21:35
< >
分享
所有回答(1)
0

Background="{x:Null}" 设为透明试试?

gaobowen | 园豆:402 (菜鸟二级) | 2016-11-18 16:06

不行的

支持(0) 反对(0) wangmeng_xm | 园豆:189 (初学一级) | 2016-11-20 11:08
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册