This is a migrated thread and some comments may be shown as answers.

X and Y axis on Rad Chart

3 Answers 73 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Stardome20
Top achievements
Rank 1
Stardome20 asked on 23 Dec 2012, 04:21 AM
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

 

3 Answers, 1 is accepted

Sort by
0
Evgenia
Telerik team
answered on 25 Dec 2012, 03:24 PM
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.
0
Stardome20
Top achievements
Rank 1
answered on 25 Dec 2012, 11:17 PM
Hi, do you mind posting that reply again? cause I could not see the replied
0
Evgenia
Telerik team
answered on 27 Dec 2012, 09:14 AM
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.
Tags
General Discussions
Asked by
Stardome20
Top achievements
Rank 1
Answers by
Evgenia
Telerik team
Stardome20
Top achievements
Rank 1
Share this question
or