I tried the following code, which works perfectly, except that it generates an error message to the Output window. The error message is:
Failed to set property 'CorrType' for indicator 'Correlation3': Exception has been thrown by the target of an invocation.
What is the reason for the error message, and can you please tell me how to set the plot color from another property setter without triggering an error message, or else stop sending the error message?
Thanks.
public CorrelationType CorrType
{
get { return corrType; }
set
{
corrType = value;
switch (corrType)
{
case CorrelationType.Pearson:
Plots[0].Pen.Color = Color.CornflowerBlue;
break;
case CorrelationType.Rank:
Plots[0].Pen.Color = Color.Red;
break;
case CorrelationType.Residual:
Plots[0].Pen.Color = Color.ForestGreen;
break;
case CorrelationType.PctChange:
Plots[0].Pen.Color = Color.Purple;
break;
}
}
}

Comment