Chart for WinRT > Task-Based Help > Combining Chart Types > Adding XYDataSeries to a Stacked Column Chart |
To add XYDataSeries to a Stacked Column chart, complete the following:
Example Title |
Copy Code
|
---|---|
// 5 points var ds1 = new XYDataSeries() { XValuesSource = new double[]{ 1, 2, 3, 4, 5}, ValuesSource = new double[] { 1, 1, 1, 1, 1} }; c1Chart1.Data.Children.Add(ds1); // 3 points var ds2 = new XYDataSeries() { XValuesSource = new double[] { 1, 3, 5 }, ValuesSource = new double[] { 1, 1, 1 } }; c1Chart1.Data.Children.Add(ds2); c1Chart1.ChartType = ChartType.ColumnStacked; |