public void GenerateChart2(string indicator, string shift, string fromdate, string todate, string unit, string mchn, Series series, int numOfPoints) { lock (thisLock) { try { Random rand; rand = new Random(20); DBServer db = new DBServer(); DataSet dss = new DataSet(); dss = db.labor_chart(shift, fromdate, todate, unit, mchn, db); if (dss.Tables[0].Rows.Count > 0) { Chart3.DataSource = dss.Tables[0]; int row = 0; if (dss.Tables[0].Rows.Count > 0) { string[] x = new string[dss.Tables[0].Rows.Count]; string[] y = new string[dss.Tables[0].Rows.Count]; for (int i = 0; i < dss.Tables[0].Rows.Count; i++) { row += 1; x[i] = Convert.ToString(row); y[i] = Convert.ToString(dss.Tables[0].Rows[i]["total_time"]); Chart3.Series[0].Points.AddY(Convert.ToString(dss.Tables[0].Rows[i]["total_time"])); //Chart1.Series["Default"].Points.DataBindXY(x, y); } } } else { ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "alert('No Record found !');", true); } } catch (Exception ex) { ExceptionLogging.SendExcepToDB(ex); } } }