Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You have two options,</p> <p>1) Use <a href="http://zedgraph.sourceforge.net/documentation/html/T_ZedGraph_BoxObj.htm" rel="nofollow noreferrer">BoxObject</a> to draw at a specific region as follows</p> <p><img src="https://i.stack.imgur.com/vCtv1.jpg" alt="enter image description here"></p> <p>and you can use the source code as follows:</p> <pre><code> private void Form1_Load(object sender, EventArgs e) { // Create an instance of Graph Pane GraphPane myPane = zedGraphControl1.GraphPane; // Build a PointPairList with points based on Sine wave PointPairList list = new PointPairList(); for (double i = 0; i &lt; 36; i++) { double x = i * 10.0 + 50.0; double y = Math.Sin(i * Math.PI / 15.0) * 16.0; list.Add(x, y); } // Hide the legend myPane.Legend.IsVisible = false; // Add a curve LineItem curve = myPane.AddCurve("label", list, Color.Red, SymbolType.Circle); curve.Line.Width = 1.5F; curve.Symbol.Fill = new Fill(Color.White); curve.Symbol.Size = 5; // Make the XAxis start with the first label at 50 myPane.XAxis.Scale.BaseTic = 50; // Fill the axis background with a gradient myPane.Chart.Fill = new Fill(Color.White, Color.SteelBlue, 45.0F); // Draw Region 1 drawRegion(list[0].X, list[10].X,"Positive Cycle"); // Calculate the Axis Scale Ranges zedGraphControl1.AxisChange(); // Refresh to paint the graph components Refresh(); } private void drawRegion(double xMin, double xMax, string regName) { GraphPane pane = zedGraphControl1.GraphPane; BoxObj box = new BoxObj(xMin,20, xMax, 40.0, Color.Empty, Color.LightSteelBlue);// Color.FromArgb(225, 245, 225)); box.Location.CoordinateFrame = CoordType.AxisXYScale; box.Location.AlignH = AlignH.Left; box.Location.AlignV = AlignV.Top; // place the box behind the axis items, so the grid is drawn on top of it box.ZOrder = ZOrder.E_BehindCurves;//.D_BehindAxis;//.E_BehindAxis; pane.GraphObjList.Add(box); // Add Region text inside the box TextObj myText = new TextObj(regName, 160, -15); myText.Location.CoordinateFrame = CoordType.AxisXYScale; myText.Location.AlignH = AlignH.Right; myText.Location.AlignV = AlignV.Center; myText.FontSpec.IsItalic = true; myText.FontSpec.IsBold = false; myText.FontSpec.FontColor = Color.Red; myText.FontSpec.Fill.IsVisible = false; myText.FontSpec.Border.IsVisible = false; pane.GraphObjList.Add(myText); zedGraphControl1.Refresh(); } </code></pre> <p>2) This is a bit difficult but do-able, Draw individual vertical lines discussed here: <a href="https://stackoverflow.com/questions/6002252/zedgraph-adding-threshold-line">1</a>, <a href="https://stackoverflow.com/questions/12422398/drawing-line-on-a-click-on-zedgraph-pane">2</a> and add the required text etc.</p> <p>I suggest you to use the <code>option 1</code>, which is lot easier than 2 !</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload