日期:2014-05-20 浏览次数:20743 次
<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;
}