private void RefreshYAxis(List <fsNamedArray> yAxis, bool isY2Axis) { if (yAxis.Count > 0) { Color color; Axis graphYAxis; if (isY2Axis) { color = Color.Green; graphYAxis = fmZedGraphControl1.GraphPane.Y2Axis; } else { color = Color.Blue; graphYAxis = fmZedGraphControl1.GraphPane.YAxis; } graphYAxis.IsVisible = true; graphYAxis.Color = color; graphYAxis.Title.Text = ""; var maxValues = new double[yAxis.Count]; for (int i = 0; i < maxValues.Length; ++i) { maxValues[i] = 0; foreach (double value in yAxis[i].GetDoublesArray()) { maxValues[i] = Math.Max(maxValues[i], Math.Abs(value)); } } for (int i = 0; i < yAxis.Count; ++i) { fsNamedArray curve = yAxis[i]; string name = curve.Name; var pointList = new PointPairList(); double scale = Math.Pow(10, Math.Round(Math.Log10(maxValues[0] / maxValues[i]))); for (int pointIndex = 0; pointIndex < curve.Array.Length; ++pointIndex) { if (curve.Array[pointIndex].Defined) { pointList.Add(m_xAxis.Array[pointIndex].Value, curve.Array[pointIndex].Value * scale); } } string curveName = name; if (scale != 1.0) { curveName += " * " + scale; } LineItem zedCurve = fmZedGraphControl1.GraphPane.AddCurve(curveName, pointList, color, SymbolType.None); zedCurve.Line.Width = i + 1; zedCurve.IsY2Axis = isY2Axis; zedCurve.Line.IsAntiAlias = true; } } }
private void WriteArrayToLastColumnInTable(fsNamedArray curve) { table.RowCount = Math.Max(table.RowCount, curve.Array.Length); DataGridViewColumn column = table.Columns[table.ColumnCount - 1]; column.SortMode = DataGridViewColumnSortMode.NotSortable; column.HeaderCell.Value = curve.Name; for (int row = 0; row < curve.Array.Length; ++row) { table[table.ColumnCount - 1, row].Value = curve.Array[row].ToString(); } }
private void AddArrayToTable(fsNamedArray curve) { table.ColumnCount++; WriteArrayToLastColumnInTable(curve); }
public void AddY2Axis(fsNamedArray yAxis) { m_y2Axis.Add(yAxis); }
public void SetXAxis(fsNamedArray xAxis) { m_xAxis = xAxis; }