RadchartAxisLablesvalues

Thread is closed for posting
4 posts, 1 answers
  1. Nathan
    Nathan avatar
    13 posts
    Member since:
    Aug 2010

    Posted 17 Jun 2011 Link to this post

    Hello,
    here is my sample code,

    DataTable

     

     

    dt = new DataTable();

     

    dt.Columns.Add(

     

    "Programs");

     

    dt.Columns.Add(

     

    "Values");

     

     

    dt.Rows.Add(dt.NewRow());

    dt.Rows[0][

     

    "Programs"] = "ABC";

     

    dt.Rows[0][

     

    "Values"] = "10";

     

    dt.Rows.Add(dt.NewRow());

    dt.Rows[1][

     

    "Programs"] = "DEF";

     

    dt.Rows[1][

     

    "Values"] = "20";

     

    dt.Rows.Add(dt.NewRow());

    dt.Rows[2][

     

    "Programs"] = "GHI";

     

    dt.Rows[2][

     

    "Values"] = "30";

     

    dt.Rows.Add(dt.NewRow());

    dt.Rows[3][

     

    "Programs"] = "JKL";

     

    dt.Rows[3][

     

    "Values"] = "40";

     

    dt.Rows.Add(dt.NewRow());

    dt.Rows[4][

     

    "Programs"] = "MNO";

     

    dt.Rows[4][

     

    "Values"] = "50";

     

    dt.Rows.Add(dt.NewRow());

    dt.Rows[5][

     

    "Programs"] = "PQR";

     

    dt.Rows[5][

     

    "Values"] = "60";

     

     

    RadChart3.DataSource = dt;

    RadChart3.DataBind();

    for the above code I get the barchart, But I am not getting the Programs names like abc, def as axis lable value.

    Instead of 1,2,3..6 I want abc, def etc. please someone help me.

  2. Answer
    Evgenia
    Admin
    Evgenia avatar
    1437 posts

    Posted 22 Jun 2011 Link to this post

    Hello Nathan,

    To be able to set the XAxis Labels from the DataTable's Programs Column you should use the DataLabelsColumn  property like this:
    RadChart3.PlotArea.XAxis.DataLabelsColumn = "Programs";

    All the best,
    Evgenia
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. Nathan
    Nathan avatar
    13 posts
    Member since:
    Aug 2010

    Posted 22 Jun 2011 Link to this post

    Is it possible to export the Radchart into pdf or excel? if so, how to do it. can someone explain or provide me an example?
  4. Evgenia
    Admin
    Evgenia avatar
    1437 posts

    Posted 27 Jun 2011 Link to this post

    Hi Nathan,

    RadChart for ASP.NET AJAX does not have an Export feature. However you can use the Save() method to save the image to the server and then let the user download the image and manipulate it:
    RadChart1.Save(Server.MapPath(@"~/image.png"), System.Drawing.Imaging.ImageFormat.Png);

    You can also review this post which discusses how to put the image in memory stream which doesn't save the image to the server first.

    All the best,
    Evgenia
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Back to Top