Exemplo n.º 1
0
 /// <summary>
 /// A constructor for the user control
 /// </summary>
 /// <param name="csvFilePath">The csv file path to detect anomalies</param>
 /// <param name="colNames"> the names of the csv's columns </param>
 public LinearRegressionGraph(string csvFilePath, List <string> colNames)
 {
     InitializeComponent();
     try
     {
         this.vm          = new LinearGraphViewModel(LinearRegressionDetector.GetInstance(csvFilePath, colNames));
         this.DataContext = this.vm;
         // draw x and y axis on the canvas
         Path xAxis = CreateAxis(new System.Windows.Point(margin, LinearGraph.Height / 2), new System.Windows.Point(LinearGraph.Width, LinearGraph.Height / 2));
         LinearGraph.Children.Add(xAxis);
         Path yAxis = CreateAxis(new System.Windows.Point(LinearGraph.Width / 2, LinearGraph.Height), new System.Windows.Point(LinearGraph.Width / 2, 0));
         LinearGraph.Children.Add(yAxis);
     }
     catch { }
 }