Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2349
Line Chart Error: You must have at least one row and one numeric column
posted

What am I doing wrong?

                DataTable dt = new DataTable();
                dt.Columns.Add("Value");
                dt.Columns.Add("Date");

                DataRow row = dt.NewRow();
               
                row[0] = "2";
                row[1] = DateTime.Today.AddDays(-1);

                dt.Rows.Add(row);

                row = dt.NewRow();

                row[0] = "3";
                row[1] = DateTime.Today.AddDays(-2);

                dt.Rows.Add(row);


                row = dt.NewRow();

                row[0] = "4";
                row[1] = DateTime.Today.AddDays(-3);

                dt.Rows.Add(row);

                myChart.DataSource = dt;               
                myChart.DataBind();