Hello,
I'm trying to produce a Line chart that will show me the evolution of the amount of issues for each category over time.
I'm not being able to acomplish it.
I'm looping through a List of categories and for each category I'm creating a ChartSeries where I'm adding ChartSeriesItems containing as YValue their count.
As a side note, for each category I'm fetching its associated Issues and then I'm groupping them by the month and year part of its creation date.
The final output is exactly what I need but...When I run the chart, the dates are showing up on the Y axis (hey what?!!) although I'm explicitly assigning the count of Issues to the YValue of each ChartSeriesItem!
Here's my code (the important part of it) :
I have an IEnumerable that creates my ChartSeries (each category will be a serie):
Then, I assign the series to my chart on the NeedDataSource Event:
Since I can't send you the project files (they're part of a big big solution with lots of dependencies) I'm attaching a screenshot of the resulting Chart.
Please help, what am I doing wrong here??
I'm trying to produce a Line chart that will show me the evolution of the amount of issues for each category over time.
I'm not being able to acomplish it.
I'm looping through a List of categories and for each category I'm creating a ChartSeries where I'm adding ChartSeriesItems containing as YValue their count.
As a side note, for each category I'm fetching its associated Issues and then I'm groupping them by the month and year part of its creation date.
The final output is exactly what I need but...When I run the chart, the dates are showing up on the Y axis (hey what?!!) although I'm explicitly assigning the count of Issues to the YValue of each ChartSeriesItem!
Here's my code (the important part of it) :
I have an IEnumerable that creates my ChartSeries (each category will be a serie):
private IEnumerable<ChartSeries> CategoryEvolutionSeries(Telerik.Reporting.Chart chart) |
{ |
var cats = issues.GroupBy(x => x.CategoryName); |
List<string> Categorias = new List<string>(); |
foreach (var cat in cats) |
{ |
Categorias.Add(cat.Key); |
} |
foreach (string cat in Categorias) |
{ |
var IssuesPerCat = issues.Where(x => x.CategoryName == cat); |
var group = IssuesPerCat.GroupBy(x => x.DateCreated.ToString("yyyy/MM")); |
ChartSeries series = new ChartSeries(); |
series.Appearance.PointMark.Dimensions.Width = 5; |
series.Appearance.PointMark.Dimensions.Height = 5; |
series.Appearance.PointMark.FillStyle.MainColor = Color.Black; |
series.Appearance.PointMark.Visible = true; |
group = group.OrderBy(x => x.Key); |
series.Appearance.LabelAppearance.Visible = false; |
series.Appearance.ShowLabels = true; |
series.Name = cat; |
series.Type = ChartSeriesType.Line; |
foreach (var issue in group) |
{ |
ChartSeriesItem item = new ChartSeriesItem(); |
item.YValue = issue.Count(); |
series.Items.Add(item); |
} |
yield return series; |
} |
} |
Then, I assign the series to my chart on the NeedDataSource Event:
defChart.Series.Clear(); |
foreach (ChartSeries item in evolseries) |
{ |
defChart.Series.Add(item); |
} |
Since I can't send you the project files (they're part of a big big solution with lots of dependencies) I'm attaching a screenshot of the resulting Chart.
Please help, what am I doing wrong here??