Hi,
I am creating a StackedBar chart from the code behind, where each item on the Y axis is the name of a Customer, and the X values are the amount of invoices completed/outstanding today. Please see the attached screenshot for an example.
It's working well, except the labels for each item on the Y axis is a meaningless number (1-5). How can I get the label to be 'Name' property of each item?
Thanks - the code is below
I am creating a StackedBar chart from the code behind, where each item on the Y axis is the name of a Customer, and the X values are the amount of invoices completed/outstanding today. Please see the attached screenshot for an example.
It's working well, except the labels for each item on the Y axis is a meaningless number (1-5). How can I get the label to be 'Name' property of each item?
Thanks - the code is below
IEnumerable<Invoice> invs = Invoice.GetTestInvoices(100);
var s = from i
in
invs
group i by i.Name;
ChartSeries chtOutstanding =
new
ChartSeries(
"Outstanding"
, ChartSeriesType.StackedBar);
ChartSeries chtCompleted =
new
ChartSeries(
"Completed"
, ChartSeriesType.StackedBar);
chtOutstanding.Appearance.LabelAppearance.LabelLocation = Telerik.Charting.Styles.StyleSeriesItemLabel.ItemLabelLocation.Inside;
chtCompleted.Appearance.LabelAppearance.LabelLocation = Telerik.Charting.Styles.StyleSeriesItemLabel.ItemLabelLocation.Inside;
foreach
(var item
in
s.OrderBy(a => a.Key))
{
chtCompleted.AddItem(item.Where(a => a.Status == 1).Count());
chtOutstanding.AddItem(item.Where(a => a.Status != 1).Count());
}
RadChart1.Series.Add(chtOutstanding);
RadChart1.Series.Add(chtCompleted);