private void predictButton_Click(object sender, EventArgs e) { chart2.Series["Total"].Points.Clear(); PredictUsage pu = new PredictUsage(); double[] totalMean = pu.TotalCalculations(eventsData); for (int i = 0; i < totalMean.Length; i++) { chart2.Series["Total"].Points.AddXY(i, totalMean[i]); } }