//--------------------------------------------- #region Public Members public void UpdateGraph() { m_graphBars.Clear(); String[] labels = new String[m_histogram.Values.Length]; for (int i = 0; i < m_histogram.Values.Length; i++) { m_graphBars.AddPoint(i, m_histogram.Bins[i].Value); labels[i] = m_histogram.Bins[i].Range.ToString("N2"); } zedGraphControl1.GraphPane.XAxis.Scale.TextLabels = labels; zedGraphControl1.GraphPane.XAxis.Scale.FontSpec.Angle = 45.0f; zedGraphControl1.AxisChange(); zedGraphControl1.Invalidate(); }
//--------------------------------------------- #region Public Members /// <summary> /// Forces a update of the Histogram bins. /// </summary> public void UpdateGraph() { graphBars.Clear(); String[] labels = new String[histogram.Values.Length]; for (int i = 0; i < histogram.Values.Length; i++) { graphBars.AddPoint(i, histogram.Bins[i].Value); labels[i] = histogram.Bins[i].Range.Min.ToString(formatString, CultureInfo.CurrentCulture) + " - " + histogram.Bins[i].Range.Max.ToString(formatString, CultureInfo.CurrentCulture); } zedGraphControl.GraphPane.XAxis.Scale.TextLabels = labels; zedGraphControl.GraphPane.XAxis.Scale.FontSpec.Angle = 45.0f; zedGraphControl.AxisChange(); zedGraphControl.Invalidate(); }
public void drawNextSpot_curve(int ID) { if (init_Curves) { initCurves(); init_Curves = false; } else { if (ID > 3 || ID < 0) { return; } if (ID == 0) { bar0.AddPoint(1, values[0]); } if (ID == 1) { bar1.AddPoint(2, values[1]); } if (ID == 2) { bar2.AddPoint(3, values[2]); } if (ID == 3) { bar3.AddPoint(4, values[3]); } //zedGraphControl1.AxisChange(); zedGraphControl1.Refresh(); zedGraphControl1.Invalidate(); } }
/// <summary> /// /// </summary> public void UpdatePane() { // Make up some random data points string[] labels = { "1", "2", "3", "4", "5", "6", "7" }; double[] y = { loop1, loop2, loop3, loop4, loop5, loop6, loop7 }; double[] z = { loopwdead1, loopwdead2, loopwdead3, loopwdead4, loopwdead5, loopwdead6, loopwdead7 }; double[] avgy = { avgloop1, avgloop2, avgloop3, avgloop4, avgloop5, avgloop6, avgloop7 }; double[] avgz = { avgloopwdead1, avgloopwdead2, avgloopwdead3, avgloopwdead4, avgloopwdead5, avgloopwdead6, avgloopwdead7 }; try { // Generate a red bar with "Curve 1" in the legend if (myBar1 == null) { /// Generate a black line with "Curve 4" in the legend average7curve = graphpane.AddCurve("Avg Hands()", null, avgy, Color.Aqua, SymbolType.Circle); //average7curve.Line.Fill = new Fill(Color.White, Color.LightSkyBlue, -45F); //// Fix up the curve attributes a little average7curve.Symbol.Size = 8.0F; average7curve.Symbol.Fill = new Fill(Color.White); average7curve.Line.Width = 2.0F; /// Generate a black line with "Curve 4" in the legend average5curve = graphpane.AddCurve("Avg Hands() w/dead", null, avgz, Color.BlueViolet, SymbolType.TriangleDown); //average7curve.Line.Fill = new Fill(Color.White, Color.LightSkyBlue, -45F); //// Fix up the curve attributes a little average5curve.Symbol.Size = 8.0F; average5curve.Symbol.Fill = new Fill(Color.White); average5curve.Line.Width = 2.0F; myBar1 = graphpane.AddBar("Inline", null, y, Color.Violet); myBar2 = graphpane.AddBar("Inline W/Dead", null, z, Color.Blue); myBar1.Bar.Fill = new Fill(Color.Aqua, Color.White, Color.Aqua); myBar2.Bar.Fill = new Fill(Color.CadetBlue, Color.White, Color.CadetBlue); } else { int size = myBar1.NPts; for (int i = 0; i < size; i++) { myBar1.RemovePoint(0); } foreach (double v in y) { myBar1.AddPoint(v, v); } size = myBar2.NPts; for (int i = 0; i < size; i++) { myBar2.RemovePoint(0); } foreach (double v in z) { myBar2.AddPoint(v, v); } size = average7curve.NPts; for (int i = 0; i < size; i++) { average7curve.RemovePoint(0); } foreach (double v in avgy) { average7curve.AddPoint(v, v); } size = average5curve.NPts; for (int i = 0; i < size; i++) { average5curve.RemovePoint(0); } foreach (double v in avgz) { average5curve.AddPoint(v, v); } } // Draw the X tics between the labels instead of // at the labels //graph.GraphPane.XAxis.M.IsBetweenLabels = true; // Set the XAxis labels graphpane.XAxis.Scale.TextLabels = labels; // Set the XAxis to Text type graphpane.XAxis.Type = AxisType.Text; } catch { } }