Input ser ie: 86400 точек Out ser ie: 86400 точек Но правые значения на выходе смещены на 3600 индексов (размер окна). Я пробовал несколько параметров, но безуспешно.
Это ошибка в FinancialFormula.TriangularMovingAverage ???
Chart Graph
private void but_Calc_Click(object sender, EventArgs e)
{
var csvParserService = new CsvParserService();
var result = csvParserService.ReadCsvFileToMesureModel(ficBox.Text);
string compte = result.Count.ToString();
countBox.Text = compte;
//var out.System.Windows.Forms.DataVisualization.Charting.FinancialFormula(FinancialFormula.TriangularMovingAverage, "20", "Series1:Y2", "Series2:Y");
chart1.Series.Clear();
var series1 = new System.Windows.Forms.DataVisualization.Charting.Series
{
Name = "Series1",
Color = System.Drawing.Color.Green,
IsVisibleInLegend = false,
IsXValueIndexed = true,
ChartType = SeriesChartType.Line
};
this.chart1.Series.Add(series1);
for (int i = 0; i < result.Count; i++)
{
series1.Points.AddXY(result[i].Date, result[i].gen);
}
var series2 = new System.Windows.Forms.DataVisualization.Charting.Series
{
Name = "Series2",
Color = System.Drawing.Color.Red,
IsVisibleInLegend = false,
IsXValueIndexed = true,
ChartType = SeriesChartType.Line
};
this.chart1.Series.Add(series2);
this.chart1.DataManipulator.IsStartFromFirst = true; //on part de zéro mais il y a un décallage de la fenêtre
this.chart1.DataManipulator.FinancialFormula(FinancialFormula.TriangularMovingAverage, "3601,true", series1, series2);
for (int i = 0; i < series2.Points.Count; i++)
{
result[i].TriMA= Convert.ToDecimal(series2.Points[i].YValues[0].ToString());
}
chart1.Invalidate();
string file_out = ficBox.Text.Replace(".csv", "_out.csv");
csvParserService.WriteNewCsvFile(@file_out, result);
}