public void Button1_Click_2(object sender, EventArgs e) { //it must be taken from dbs the dates and weights in order to output this.progressChart.Series["Weight"].Points.Clear(); string con = MyMethodsLib.GetConnectionString(); var dates = MyMethodsLib.GetDatesOfInputWeight(Username, con); var weightInputs = MyMethodsLib.GetWeightInputs(Username, con); int track = 0; foreach (String date in dates) { this.progressChart.Series["Weight"].Points.AddXY(date, weightInputs[track]); track += 1; } this.progressChart.ChartAreas["ChartArea1"].AxisX.Title = "Date"; this.progressChart.ChartAreas["ChartArea1"].AxisY.Title = "Your Weight"; }