X and Y axis on Rad Chart

4 posts, 0 answers
  1. Stardome20
    Stardome20 avatar
    7 posts
    Member since:
    Nov 2012

    Posted 22 Dec 2012 Link to this post

    I am using 3 tier programming
    So in my Data Access Layer I have the following code
    public List<AdvertisementDAL> displayChart()
    {
        List<AdvertisementDAL> dal = new List<AdvertisementDAL>();
        string sql = "Select * From AdvertisementRecord";
        SqlConnection conn = new SqlConnection(_connStr);
        SqlCommand cmd = new SqlCommand(sql, conn);
        conn.Open();
        SqlDataReader dr = cmd.ExecuteReader();
        while (dr.Read())
        {
            _recordID = int.Parse(dr["RecordID"].ToString());
            _recordDate = dr["RecordDate"].ToString();
            _noOfClick = int.Parse(dr["NoOfClick"].ToString());
            _noOfView = int.Parse(dr["NoOfView"].ToString());
            _advertisementID = int.Parse(dr["FK_AdvertisementID"].ToString());
            dal.Add(new AdvertisementDAL(_recordID, _recordDate, _noOfClick, _noOfView, _advertisementID));
        }
        conn.Close();
        dr.Close();
        dr.Dispose();
        return dal;
    }

    In my business Logic Code I have this:
    public List<AdvertisementDAL> pieChart()
    {
        AdvertisementDAL dal = new AdvertisementDAL();
        List<AdvertisementDAL> dll = new List<AdvertisementDAL>();
        dll = dal.displayChart();
        return dll;
    }

    In my Presentation Layer I have the following code:
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
     
            AdvertisementBLL bll = new AdvertisementBLL();
            RadChart1.DataSource = bll.pieChart();
            RadChart1.DataBind();
             
     
        }
    }

    So here is the real problem start:
    I want to display in this way
    On my Y Axis Label( look at the attachment)
    It will be the record date( 12/21/2012, 12/22/2012, 12/23/2012)
    On my X Axis Label(look at the attachment)
    It will be 1 to 100 
    My series 1 will be NoOfClick
    My series 2 will be NoOfView

    I tried the following but it said
    The type of column with name Record Date is not numeric

     
  2. Evgenia
    Admin
    Evgenia avatar
    1437 posts

    Posted 25 Dec 2012 Link to this post

    Hello Koh,

    RadChart provides support only for numerical data display (the DataYColumn property provides source for the YValue-s of the chart items thus it can only be numerical). That said, you should be able to provide integer as well as double values for the YValue property.
    What is the most wanted and supported scenario with RadChart is populating the XAxis with DateTime values and the YAxis with double-s. If this is your case, you may review this online demo with source code provided.

    Regards,
    Evgenia
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. Stardome20
    Stardome20 avatar
    7 posts
    Member since:
    Nov 2012

    Posted 25 Dec 2012 Link to this post

    Hi, do you mind posting that reply again? cause I could not see the replied
  4. Evgenia
    Admin
    Evgenia avatar
    1437 posts

    Posted 27 Dec 2012 Link to this post

    Hi Koh,

     You should be able to see it now.

    Kind regards,
    Evgenia
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top