示例#1
0
        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);
        }
示例#2
0
 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();
     }
 }