jesper

jesper

  • 1.9k
  • 89
  • 44.9k

Chart and dates on x axis

Oct 15 2013 5:40 AM
well.. i have a chart, have written this:

            DataAccess dt = new DataAccess();

            SqlConnection conn = dt.connection();
            conn.Open();

            string sqlStr = "SELECT Date, Counts FROM Chart";

            SqlDataAdapter myCommand = new SqlDataAdapter(sqlStr, conn);

            DataSet ds = new DataSet();

            myCommand.Fill(ds);

            DataView source = new DataView(ds.Tables[0]);

            Chart1.DataSource = source;

            Chart1.Series[0].XValueMember = "Date";
            Chart1.Series[0].YValueMembers = "Counts";

            Chart1.DataBind();

in my database i only have 1 date currently. and still when i compile and see it, on the x axis i have i dates starting from yesterday end date tomorrow..

why dosent it not just show the date(s) from the database. ?