public static void ClearQuick(this System.Windows.Forms.DataVisualization.Charting.DataPointCollection Points) { Points.SuspendUpdates(); while (Points.Count > 0) { Points.RemoveAt(Points.Count - 1); } Points.ResumeUpdates(); }
public void add(int cer, System.Windows.Forms.DataVisualization.Charting.DataPointCollection points) { int id = zile.Count; zile.Add(id); cereri.Add(cer); points.AddXY("Zi " + zile[id], cer); changed = true; }
public void set(string nm, string q, System.Windows.Forms.DataVisualization.Charting.DataPointCollection points) { nume = nm; points.Clear(); if (q != "") { string[] xq = q.Split('|'); foreach (string x in xq) { string[] xxq = x.Split(','); zile.Add(Int32.Parse(xxq[0])); cereri.Add(Int32.Parse(xxq[1])); points.AddXY("Zi " + xxq[0], Int32.Parse(xxq[1])); } } changed = false; }
public List <double[]> getSignatures(System.Windows.Forms.DataVisualization.Charting.DataPointCollection dataPoints) { int r1 = -1, r2 = 0; double weight = 0, totalWeight = 0; List <double[]> sigList = new List <double[]>(); //double area = dataPoints. int length = dataPoints.Count; for (int i = length - 1; i > 0; i--) { double angCurrent = dataPoints[i].YValues[0]; if ((angCurrent > 0.01) && (r1 == -1)) { r1 = i; } ; if (r1 != -1 && angCurrent < 0.05) { r2 = i; //r1 = 0; } if ((r1 != -1 && r2 != 0) && (Math.Abs(r2 - r1) > 5))// && r2 != 0) { dataPoints[r2].Color = System.Drawing.Color.Yellow; dataPoints[r1].Color = System.Drawing.Color.Red; var myMem = new MemStorage(); Contour <System.Drawing.PointF> myCont = new Contour <System.Drawing.PointF>(myMem); System.Drawing.PointF myPoint = new System.Drawing.PointF(); for (int t = r1 - 1; t > r2 + 1; t--) { myPoint.X = ((float)dataPoints[t].XValue); myPoint.Y = (float)dataPoints[t].YValues[0]; //weight = weight + dataPoints[t].YValues[0]; dataPoints[t].Color = System.Drawing.Color.Silver; myCont.Push(myPoint); } weight = myCont.Area; if (weight > totalWeight) { totalWeight = weight; } // totalWeight = totalWeight + weight; myCont.Clear(); double[] sigArr = { 0, 0, 0 }; sigArr[0] = (float)dataPoints[r1].XValue; sigArr[1] = (float)dataPoints[r2].XValue; sigArr[2] = weight; //r2_2 = r1; //if (weight > 0.5) { } sigList.Add(sigArr); r2 = 0; weight = 0; r1 = -1; } } //totalWeight = dataPoints.FindMaxByValue().YValues[0]; // textBox1.Text = totalWeight.ToString(); // foreach (double[] sign in sigList) // { // sign[2] = sign[2] / totalWeight; //} return(sigList); }