/// <summary> /// Add a stick graph (<see cref="StickItem"/> object) to the plot with /// the given data points (<see cref="IPointList"/>) and properties. /// This is simplified way to add curves without knowledge of the /// <see cref="CurveList"/> class. An alternative is to use /// the <see cref="ZedGraph.CurveList" /> Add() method. /// </summary> /// <param name="label">The text label (string) for the curve that will be /// used as a <see cref="Legend"/> entry.</param> /// <param name="points">A <see cref="IPointList"/> of double precision value pairs that define /// the X and Y values for this curve</param> /// <param name="color">The color to used for the curve line, /// symbols, etc.</param> /// <returns>A <see cref="CurveItem"/> class for the newly created curve. /// This can then be used to access all of the curve properties that /// are not defined as arguments to the /// <see cref="AddStick(string,IPointList,Color)"/> method.</returns> public StickItem AddStick( string label, IPointList points, Color color ) { StickItem curve = new StickItem( label, points, color ); _curveList.Add( curve ); return curve; }
/// <summary> /// Add a stick graph (<see cref="StickItem"/> object) to the plot with /// the given data points (double arrays) and properties. /// This is simplified way to add curves without knowledge of the /// <see cref="CurveList"/> class. An alternative is to use /// the <see cref="ZedGraph.CurveList" /> Add() method. /// </summary> /// <param name="label">The text label (string) for the curve that will be /// used as a <see cref="Legend"/> entry.</param> /// <param name="x">An array of double precision X values (the /// independent values) that define the curve.</param> /// <param name="y">An array of double precision Y values (the /// dependent values) that define the curve.</param> /// <param name="color">The color to used for the curve line, /// symbols, etc.</param> /// <returns>A <see cref="StickItem"/> class for the newly created curve. /// This can then be used to access all of the curve properties that /// are not defined as arguments to the /// <see cref="AddStick(string,double[],double[],Color)"/> method.</returns> public StickItem AddStick( string label, double[] x, double[] y, Color color ) { StickItem curve = new StickItem( label, x, y, color ); _curveList.Add( curve ); return curve; }
/// <summary> /// The Copy Constructor /// </summary> /// <param name="rhs">The <see cref="StickItem"/> object from which to copy</param> public StickItem( StickItem rhs ) : base(rhs) { }
/// <summary> /// The Copy Constructor /// </summary> /// <param name="rhs">The <see cref="StickItem"/> object from which to copy</param> public StickItem(StickItem rhs) : base(rhs) { }
public static void GetRangeY(StickItem curve, int fromId, int toId, ref ValueRange yRange) { for (int idx = fromId; idx <= toId; idx++) { PointPair item = (PointPair)curve.Points[idx]; if (item.Y < yRange.Min) yRange.Min = item.Y; if (item.Y > yRange.Max) yRange.Max = item.Y; } }
public static void GetRangeY(StickItem curve, int fromId, int toId, ref ValueRange yRange) { fromId = Math.Max(fromId, 0); toId = Math.Min(toId, curve.Points.Count - 1); for (int idx = fromId; idx <= toId; idx++) { if (idx < 0 || idx >= curve.Points.Count) continue; PointPair item = (PointPair)curve.Points[idx]; if (item.Y < yRange.Min) yRange.Min = item.Y; if (item.Y > yRange.Max) yRange.Max = item.Y; } }