private void zedGraphControlMain_DoubleClick(object sender, EventArgs e) { conLog.Add("Graph"); if (perspective.withLine) { var pane = zedGraphControlMain.GraphPane; if (perspective.withCurLine) { pane.CurveList.Remove(pane.CurveList.Count - 1); perspective.withCurLine = false; } var repeatMainLine = false; if (perspective.withMainLine) { pane.CurveList.Remove(pane.CurveList.Count - 1); repeatMainLine = perspective.mainLineX == perspective.curLineX; perspective.withMainLine = false; } perspective.mainLineX = perspective.curLineX; if (!repeatMainLine) { var gp = new GraphProcessing(); gp.drawVerticalLine(perspective, true); perspective.withMainLine = true; } zedGraphControlMain.AxisChange(); if (pane.GraphItemList.Count != 0) { pane.GraphItemList.RemoveAt(0); } Method.Trial trialOfMin = new Method.Trial(); foreach (var pointInfo in perspective.methodInfo.report.iterations) { if (perspective.curLineX == pointInfo.x) { trialOfMin = pointInfo; break; } } var point = new ZedGraph.TextItem(string.Format("{0}({1}; {2})", trialOfMin.i - 2, trialOfMin.x, trialOfMin.y), (float)trialOfMin.x, (float)pane.YAxis.Max); point.FontSpec.FontColor = perspective.colorLine; point.FontSpec.Border.Color = perspective.colorPoint; point.FontSpec.Fill.Color = perspective.colorBack; //point.FontSpec.Angle = 2; pane.GraphItemList.Add(point); zedGraphControlMain.Invalidate(); } }
public void ClickOnTableLayoutPanel(object sender, MouseEventArgs e) { int column = tableLayoutPanel.GetColumn((Control)sender); var control = tableLayoutPanel.GetControlFromPosition(column, 0); var param = control.Text.Split('\n'); if (perspective.withLine) { var pane = zedGraphControlMain.GraphPane; if (perspective.withCurLine) { pane.CurveList.Remove(pane.CurveList.Count - 1); perspective.withCurLine = false; } if (perspective.withMainLine) { pane.CurveList.Remove(pane.CurveList.Count - 1); perspective.withMainLine = false; } perspective.mainLineX = perspective.curLineX; var gp = new GraphProcessing(); gp.drawVerticalLine(perspective, true); perspective.withMainLine = true; zedGraphControlMain.AxisChange(); if (pane.GraphItemList.Count != 0) { pane.GraphItemList.RemoveAt(0); } Method.Trial trialOfMin = new Method.Trial(); trialOfMin = perspective.methodInfo.report.iterations[int.Parse(param[0]) + 1]; var point = new ZedGraph.TextItem(string.Format("{0}({1}; {2})", trialOfMin.i - 2, trialOfMin.x, trialOfMin.y), (float)trialOfMin.x, (float)pane.YAxis.Max); point.FontSpec.FontColor = perspective.colorLine; point.FontSpec.Border.Color = perspective.colorPoint; point.FontSpec.Fill.Color = perspective.colorBack; //point.FontSpec.Angle = 2; pane.GraphItemList.Add(point); zedGraphControlMain.Invalidate(); } }