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

RadchartAxisLablesvalues

3 Answers 40 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Nathan
Top achievements
Rank 1
Nathan asked on 17 Jun 2011, 10:01 PM
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.

3 Answers, 1 is accepted

Sort by
0
Accepted
Evgenia
Telerik team
answered on 22 Jun 2011, 12:08 PM
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.

0
Nathan
Top achievements
Rank 1
answered on 22 Jun 2011, 08:44 PM
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?
0
Evgenia
Telerik team
answered on 27 Jun 2011, 02:04 PM
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.

Tags
Chart (Obsolete)
Asked by
Nathan
Top achievements
Rank 1
Answers by
Evgenia
Telerik team
Nathan
Top achievements
Rank 1
Share this question
or