12-23-2004 10:31 AM
12-23-2004 01:28 PM
// The parameters used for configuring the user interface.
double centreFrequency = 100;
double sweepRange = 20;
int numSweeps = 4;
// Configure centre cursor.
XYCursor centreCursor = new XYCursor();
centreCursor.SnapMode = CursorSnapMode.Fixed;
centreCursor.XPosition = centreFrequency;
centreCursor.HorizontalCrosshairMode = CursorCrosshairMode.None;
centreCursor.PointStyle = PointStyle.None;
centreCursor.PointSize = Size.Empty;
// Add cursor to the graph.
scatterGraph1.Cursors.Add(centreCursor);
int numAnnotations = numSweeps / 2;
double sweepIncrement = sweepRange / numSweeps;
double sweepCount = sweepIncrement;
for (int i = 0; i < numAnnotations; ++i, sweepCount += sweepIncrement)
{
// Configure annotation.
XYRangeAnnotation annotation = new XYRangeAnnotation(xAxis1, yAxis1);
annotation.XRange = new Range(centreCursor.XPosition - sweepCount, centreCursor.XPosition + sweepCount);
annotation.YRange = Range.All;
annotation.RangeFillColor = Color.FromArgb(128, annotation.RangeFillColor);
annotation.ArrowHeadStyle = ArrowStyle.None;
annotation.ArrowLineStyle = LineStyle.None;
// Add annotation to the graph.
scatterGraph1.Annotations.Add(annotation);
}
12-23-2004 03:25 PM
12-23-2004 03:51 PM
12-28-2004 10:45 AM