PieSeries饼图怎么绑定数据?

DDRsun3 2013-05-23 11:55:04

<toolkit:Chart Name="cr_ProductShow" Title="市场占有率">
<toolkit:Chart.Series>
<toolkit:PieSeries DependentValueBinding="{Binding }" IndependentValueBinding="{Binding }"/>
</toolkit:Chart.Series>
</toolkit:Chart>


数据绑定

private void Chartcontrol_Loaded(object o, RoutedEventArgs e)
{
List<KeyValuePair<string, int>> Companys = new List<KeyValuePair<string, int>>();
Companys.Add(new KeyValuePair<string, int>("宝锶", 1000));
Companys.Add(new KeyValuePair<string, int>("华为", 200));
Companys.Add(new KeyValuePair<string, int>("三星", 600));
Companys.Add(new KeyValuePair<string, int>("Apple", 100));
Companys.Add(new KeyValuePair<string, int>("Nokia", 50));
Companys.Add(new KeyValuePair<string, int>("HTC", 300));

((System.Windows.Controls.DataVisualization.Charting.PieSeries)cr_ProductShow.Series[0]).ItemsSource = Companys;
}



为什么右边那里有数据显示,但是饼图呢?是不是好要用个什么属性来显示?

还有个请况就是:
我改成
DependentValueBinding="{Binding Key}" IndependentValueBinding="{Binding Value}"
的时候,运行空白,页面全空白,什么情况?
谢谢啦
...全文
101 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
u010812061 2013-05-23
  • 打赏
  • 举报
回复
看不明
DDRsun3 2013-05-23
  • 打赏
  • 举报
回复
求帮忙看看,谢谢啦

4,816

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 图表区
社区管理员
  • 图表区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧