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

assign Date to x and y axis value in RadChart

1 Answer 146 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Saravanan
Top achievements
Rank 1
Saravanan asked on 18 Aug 2011, 09:58 AM
DataTable tbl = new DataTable();
tbl.Columns.Add("Date");
tbl.Columns.Add("City");
tbl.Columns.Add("SeriesName");
tbl.Columns.Add("XAxisLabel");
tbl.Columns.Add("YAxisLabel");

Hello telerik team, i have a table with the above structure. i need to draw a chart for the above data. the value for xaxis are in date format and y axis in string format. if i bind this datatable to RadChart object i'm getting empty series. It is accepting only numbers. Is it a limitation or i did any mistake?. And even if i give as numbers i need to group chart by series . the value for Legend should get from "SeriesName" column. Can someone help me.

1 Answer, 1 is accepted

Sort by
0
Evgenia
Telerik team
answered on 23 Aug 2011, 01:16 PM
Hello Saravanan,

There are some things you should have in mind when binding RadChart - both XAxis and YAxis expect their values to be of Double type. This means that dates should be presented in their OLE Automation equivalent using the ToOADate() method provided by the Framework. You may find our Numerical Axis demo helpful for achieving this. On the other hand to set strings as Labels for the Axis you may either set the DataLabelsColumn property or add the labels manually as shown here.
You can set Series Name which will appear as Legend Item like this:
radChart.Series[0].Name = "SeriesName";

Regards,
Evgenia
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

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