Chart for WinRT > Task-Based Help > Combining Chart Types > Adding a Bar Series and a Line Series at the Same Time |
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 } }); |