Chart for WPF and Silverlight / Chart Types / Special Chart Types and Combination Charts / Adding a Bar Series and a Line Series
In This Topic
Adding a Bar Series and a Line Series
In This Topic

To add a Bar series and a Line series programmatically, use the following code:

C#
Copy Code
chart.Data.Children.Add(new XYDataSeries() {
       ChartType=ChartType.Column,
       XValuesSource = new double[] {1,2,3 },
       ValuesSource = new double[] {1,2,3 } });

     chart.Data.Children.Add(new XYDataSeries() {
       ChartType = ChartType.Line,
       XValuesSource = new double[] { 1, 2, 3 },
       ValuesSource = new double[] { 3, 2, 1 } });
See Also