10-09-2012 06:42 AM
What is the best way to implement a limit line with different values?
For instance using a WaveformGraph with a Y scale from 50 to -10 and an X scale from 0 to 500. I need a limit line displayed in six different points going from 40, 0 , 0, 0 ,0, 40 in a linear scale. The linear scale points would be spread equally across the X scale. 40 would be on 0 on the X Scale, 0 on 100, 0 on 200 and so on. Something like the attached jpg.
Thanks
10-10-2012 07:58 PM
Have you considered plotting this limit line as another plot on the WaveformGraph? The code might look something like this:
int range = 500;
int numPoints = 500;
double increment = range / numPoints;
double startingPoint = 0.0;
double[] limitLinePoints = new double[numPoints];
double slope = 40.0 / 100.0;
for (int i = 0; i < 100; i++)
{
limitLinePoints[i] = 40 - (i * slope);
}
for (int i = 100; i < 400; i++)
{
limitLinePoints[i] = 0;
}
int j = 0;
for (int i = 400; i < 500; i++, j++)
{
limitLinePoints[i] = j * slope;
}
waveformPlot1.PlotY(limitLinePoints);
10-15-2012 09:10 AM
Thank You,
That is exately what I needed