//导入全部数据到datatable中,用于以后使用
        private void ImportTxt()
        {
            if (File.Exists(filepath))
            {
                dt_Data = new DataTable();
                dt_Data.Columns.Add("id", typeof(string));
                dt_Data.Columns.Add("time", typeof(string));
                dt_Data.Columns.Add("dxq", typeof(string));
                dt_Data.Columns.Add("rxq", typeof(string));
                dt_Data.Columns.Add("fnjcdl", typeof(string));
                dt_Data.Columns.Add("fnjcrl", typeof(string));
                dt_Data.Columns.Add("fnjxhrql", typeof(string));
                dt_Data.Columns.Add("brglcrl", typeof(string));
                dt_Data.Columns.Add("brglxhrql", typeof(string));
                dt_Data.Columns.Add("fnjdxl", typeof(string));
                dt_Data.Columns.Add("fnjrxl", typeof(string));
                dt_Data.Columns.Add("brglrxl", typeof(string));
                dt_Data.Columns.Add("sd", typeof(string));
                dt_Data.Columns.Add("sr", typeof(string));
                dt_Data.Columns.Add("gfxh", typeof(string));
                dt_Data.Columns.Add("gfcc", typeof(string));
                dt_Data.Columns.Add("gfcdl", typeof(string));
                dt_Data.Columns.Add("grxh", typeof(string));
                dt_Data.Columns.Add("grcc", typeof(string));
                dt_Data.Columns.Add("grcrl", typeof(string));
                dt_Data.Columns.Add("cdl", typeof(string));
                dt_Data.Columns.Add("crl", typeof(string));

                var file = File.Open(filepath, FileMode.Open);

                List<string> txt = new List<string>();
                using (var stream = new StreamReader(file, Encoding.GetEncoding("GB2312")))
                {
                    while (!stream.EndOfStream)
                    {
                        string strdata = stream.ReadLine();
                        DataRow dr = dt_Data.NewRow();
                        for (int i = 0; i < strdata.Split('\t').Count(); i++)
                        {
                            dr[i] = strdata.Split('\t')[i];
                        }
                        dt_Data.Rows.Add(dr);
                    }
                }
                file.Close();

                this.Dispatcher.Invoke(new Action(() =>
                            {
                                ChartLineYearUC cyu = new ChartLineYearUC("全年能耗需求");
                                this.grid_xq.Children.Add(cyu);
                                DataTable dt_e = ImportDatatable(0, 2, 1);
                                DataTable dt_h = ImportDatatable(0, 3, 1);
                                if (dt_e != null)
                                {
                                    cyu.AddLineData(dt_e, "电需求(kW)", "#FF0000FF");
                                }
                                if (dt_h != null)
                                {
                                    cyu.AddLineData(dt_h, "热需求(kW)", "#FFFF0000");
                                }

                                int j = Int32.Parse(mComboBox.SelectedValue.ToString().Trim());
                                cyu_down = new ChartLineYearUC(mComboBox.Text + "全年数据");
                                this.grid_fnj.Children.Add(cyu_down);
                                DataTable dt = ImportDatatable(0, j, 1);
                                cyu_down.AddLineData(dt, mComboBox.SelectedItem.ToString(), "#FF0DA4DC");
                            }));
            
            }
        }
 //点击确定更改下方展示曲线数据源
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     int i = Int32.Parse(mComboBox.SelectedValue.ToString().Trim());
     this.grid_fnj.Children.Clear();
     cyu_down = new ChartLineYearUC(mComboBox.Text + "全年数据");
     this.grid_fnj.Children.Add(cyu_down);
     DataTable dt = ImportDatatable(0, i, 1);
     cyu_down.AddLineData(dt, mComboBox.SelectedItem.ToString(), "#FF5B9BD5");
 }