Hello,
I want to apply a Financial Formula, but I receive this error if I specify a specific Y value to use for an input value. I really don't understand why...
This is my (sample) code:
Chart mychart = new Chart();
Series sInput = new Series("sInput");
Series sOut = new Series("sOut");
mychart.Series.Add(sInput);
mychart.Series.Add(sOut);
DataPoint dp = new DataPoint(1, new double[] { 5, 7, 3 });
sInput.Points.Add(dp);
dp = new DataPoint(2, new double[] { 3, 4, 1 });
sInput.Points.Add(dp);
dp = new DataPoint(3, new double[] { 5, 10, 1 });
sInput.Points.Add(dp);
dp = new DataPoint(4, new double[] { 8, 9, 8 });
sInput.Points.Add(dp);
dp = new DataPoint(5, new double[] { 15, 16, 14 });
sInput.Points.Add(dp);
mychart.DataManipulator.FinancialFormula(FinancialFormula.MovingAverage, "3", "sInput:Y2", "sOut");
This is the error I receive:
"System.ArgumentException {"Formula Error - Invalid Y value index.\r\nNome parametro: Y2"}"
P.S.: If I'd use the first Y Value my program works well ("sInput:Y" instead of "sInput:Y2")
Thanks in advance. I am waiting for the help please.
Regards,
Ghanzanfar Latif
[edit]code blocks added[/edit]