Using a scatterplot, I change each point's color (and shape) to reflect the range of the Y-value passed in. This is done with an override to the "draw" function (see below). Right now the Y-value ranges are "hardcoded" in the override. I would like to be able to dynamically change the range with a user entry at runtime.
I have tried adding a public function to my code which could be called to change the value of the range variable, but .NET does not recognize it. Can this, in fact, be done, or is there an alternate scheme to accomplish the same thing?
thanks.
Code (partial):
public class DynamicPointStyle : PointStyle
{
private rangeHigh = 5;
private rangeLow = 2;
public override void Draw(obj
ect context, PointStyleDrawArgs args)
{
double yValue = args.Y;
if (Math.Abs(yValue) > rangeHigh) //5dB
PointStyle.Plus.Draw(context, CreateArgs(args, Color.Red));
else if (Math.Abs(yValue) > rangeLow) //2dB
PointStyle.EmptyCircle.Draw(context, CreateArgs(args, Color.Yellow));
else
PointStyle.SolidCircle.Draw(context, CreateArgs(args, Color.Green));
}
??public void updateRange (double rHigh, double rLow)
{
rangeHigh = rHigh;
rangeLow = rLow;
}
}