Ejemplo n.º 1
0
        private void btnVeBieuDo_Click(object sender, EventArgs e)
        {
            chBieuDo.Series["Doanh thu"].Points.Clear();
            int i = 0;

            foreach (DataRow row in SachBUS.BieuDo(dtkTu.Value, dtkDen.Value).Rows)
            {
                chBieuDo.Series["Doanh thu"].Points.Add(Int64.Parse(row["Doanhthu"].ToString()));
                chBieuDo.Series["Doanh thu"].Points[i].Color       = Color.Red;
                chBieuDo.Series["Doanh thu"].Points[i].BorderWidth = 2;
                chBieuDo.Series["Doanh thu"].Points[i].AxisLabel   = DateTime.Parse(row["NgayBan"].ToString()).ToShortDateString();
                chBieuDo.Series["Doanh thu"].Points[i].Label       = string.Format("{0:0,0}", row["Doanhthu"]);
                i++;
            }

            dgvDanhSach.DataSource = SachBUS.BieuDo(dtkTu.Value, dtkDen.Value);
            Custom();
            dgvDanhSach.ClearSelection();
        }