ChartData ReadChart() { ChartData data = new ChartData(); data.Title = r.GetAttribute("Title"); while (r.Read() && !r.EOF && r.NodeType != XmlNodeType.EndElement) { switch (r.NodeType) { case XmlNodeType.Element: switch (r.LocalName) { case "Category": data.AddCategory(ReadCategory()); break; case "Series": data.AddSeries(ReadSeries()); break; } break; } } return(data); }
private void OnExport(object sender, RoutedEventArgs e) { if (PieChart.Series != null && PieChart.Series.Values.Count > 0) { ChartData data = new ChartData(); data.AddSeries(new ChartDataSeries() { Values = PieChart.Series.Values, Name = "Categories" }); data.Export(); } }