I am VERY new to Telerik and charting in particular, and need some help understanding how this control works.
My first question is a very basic one, but I can't seem to figure it out. I have a stored proc that returns to columns of data. One column has each person's name (i.e. Ted Smith) and the second column has a monetary amount (i.e. $12000). I am using the Adventureworks DB for data at the moment.
My code behind looks like this:
protected void BindData(RadChart radChart)
{
using (var sqlDataSource = new SqlDataSource
{
ID = "myDataSource",
ConnectionString =
ConfigurationManager.ConnectionStrings[
"AdventureWorksConnectionString"].ConnectionString,
SelectCommand = "GetSales"
})
{
Page.Controls.Add(sqlDataSource);
radChart.DataSourceID = "myDataSource";
radChart.PlotArea.XAxis.DataLabelsColumn = "FullName";
radChart.DataBind();
radChart.Series[0].DataYColumn = "TotalDue";
radChart.Series[0].DataXColumn = "FullName";
}
}
When I run the application, the chart shows the Y axis (TotalDue) as I would expect it to, in a numeric format. But the X axis just shows the numbers 0-8, not the names of the people. This doesn't help me much. How do I get the names of the people to show up?
My first question is a very basic one, but I can't seem to figure it out. I have a stored proc that returns to columns of data. One column has each person's name (i.e. Ted Smith) and the second column has a monetary amount (i.e. $12000). I am using the Adventureworks DB for data at the moment.
My code behind looks like this:
protected void BindData(RadChart radChart)
{
using (var sqlDataSource = new SqlDataSource
{
ID = "myDataSource",
ConnectionString =
ConfigurationManager.ConnectionStrings[
"AdventureWorksConnectionString"].ConnectionString,
SelectCommand = "GetSales"
})
{
Page.Controls.Add(sqlDataSource);
radChart.DataSourceID = "myDataSource";
radChart.PlotArea.XAxis.DataLabelsColumn = "FullName";
radChart.DataBind();
radChart.Series[0].DataYColumn = "TotalDue";
radChart.Series[0].DataXColumn = "FullName";
}
}
When I run the application, the chart shows the Y axis (TotalDue) as I would expect it to, in a numeric format. But the X axis just shows the numbers 0-8, not the names of the people. This doesn't help me much. How do I get the names of the people to show up?