public MainWindow() { InitializeComponent(); Drawer pen = new Drawer(predictionChart); Drawer pen2 = new Drawer(predictionChart2); Drawer pen3 = new Drawer(predictionChart3); List <double> vs = new List <double>(); for (int i = 0; i < 30; i++) { vs.Add(Math.Sin(i)); } pen.DrawLinerChart(vs.ToArray(), "Pred"); var pred = PredictionUpdate.Prediction(vs, 20, true); pen.DrawLinerChart(pred.ToArray(), "Pred"); MainData mainData = new MainData(); mainData.Load_TXT("Сетевые-атаки(кол-во).txt"); var pred2 = PredictionUpdate.Prediction(mainData.GetData().ToList(), 0, true); pen3.DrawLinerChart(pred2.ToArray(), "pred"); pen3.DrawLinerChart(mainData.GetData(), "main"); MainData mainData2 = new MainData(); mainData2.Load_TXT("Сетевые-атаки.txt"); var pred3 = PredictionUpdate.Prediction(mainData2.GetData().ToList(), 0, true); pen2.DrawLinerChart(pred3.ToArray(), "pred"); pen2.DrawLinerChart(mainData2.GetData(), "main"); }
public static void StartWorkData(CartesianChart cc, DataGrid dg) { MainData main_data = new MainData(); Drawer pen = new Drawer(cc); OpenFileDialog ofd = new OpenFileDialog(); string path = ""; if (ofd.ShowDialog() == true) { path = ofd.FileName; } main_data.Load_TXT(path); double[] arr_mainData = main_data.GetData(); if (arr_mainData != null) { arr_data = arr_mainData; pen.DrawLinerChart(arr_mainData, "Основные данные"); List <DataM> datato_table = new List <DataM>(); int length = arr_mainData.Length; for (int i = 0; i < length; i++) { datato_table.Add(new DataM { t = i, x = arr_mainData[i] }); } dg.ItemsSource = datato_table; } }