silverlight toolkit Chart(一)

何浩荡
2023-12-01
 Chart chart = new Chart();
            chart.Title = "11111";


            Dictionary<string, double> dic = new Dictionary<string, double>();


            dic.Add("A",100);
            dic.Add("B", 130);
            dic.Add("C", 150);
            dic.Add("D", 170);
            dic.Add("W", 190);


            DataPointSeries ser = new ColumnSeries() as DataPointSeries;


            ser.IndependentValueBinding = new System.Windows.Data.Binding("Key");
            ser.DependentValueBinding = new System.Windows.Data.Binding("Value");
            ser.ItemsSource = dic;
            chart.Series.Add(ser);
	    //Y轴标题
            DisplayAxis valueAxis = new CategoryAxis { Orientation = AxisOrientation.Y, Title = "薪水", FontStyle = FontStyles.Normal};
            chart.Axes.Add(valueAxis);
            LayoutRoot.Children.Add(chart);

 类似资料: