Hello,
I have a Q3 2012 HtmlRadChart, trying to bind it with List<> values. A list item object has properties CreatedDate, Name and Value. I want to display CreatedDate on XAxis, Name as legend and Value as series. Code:
The problem is that chart does not "filter" values, and displays all values for every Name in the names list, overriding the other series displayed.
As you can see in attachment, I have 13 values for all 3 Names (PT206, PT208, PT205) and all of them are displayed for every Name, thus, lines are overriten by each other.
How can I filter data source by names, to display the series correctly?
Thanks,
Ion
I have a Q3 2012 HtmlRadChart, trying to bind it with List<> values. A list item object has properties CreatedDate, Name and Value. I want to display CreatedDate on XAxis, Name as legend and Value as series. Code:
var source = (from r in readData join sen in equipments on r.EquipmentId equals sen.Id
select new
{
Id = r.Id,
CreatedDate = r.CreatedDate,
Value = r.Value,
Name = sen.Name,
EquipmentId = sen.Id
})
.ToList();
chart.PlotArea.Series.Clear();
foreach (var equipment in source.Select(src => src.Name).Distinct())
{
var equipmentLineSeries = new LineSeries
{
DataField = "Value",
Name = equipment,
};
chart.PlotArea.Series.Add(equipmentLineSeries);
}
chart.DataSource = source;
chart.DataBind();
The problem is that chart does not "filter" values, and displays all values for every Name in the names list, overriding the other series displayed.
As you can see in attachment, I have 13 values for all 3 Names (PT206, PT208, PT205) and all of them are displayed for every Name, thus, lines are overriten by each other.
How can I filter data source by names, to display the series correctly?
Thanks,
Ion