This question is locked. New answers and comments are not allowed.
I am trying to create a chart based on data that I get from a service.
My data comes to me in this form:
public class ReportData
{
public List<QueryResult> QueryResults { get; set; }
}
public class QueryResult
{
public DateTime DataDate { get; set; }
public List<QueryComponent> DataItems { get; set; }
}
public class QueryComponent
{
public DateTime DataDate { get; set; }
public string ItemName { get; set; }
public double ItemValue { get; set; }
}
What I am trying to do is bind this data to a chart where there are several series. Each series is based on the "ItemName". For example List<QueryComponent> is going to have several DataItems with the ItemName "Cars" and I want that to become a series in the chart. ItemName can have many different values (i.e. Cars, Trucks, Bikes, People, Cats, Dogs, etc) and I do not know all of them.
Is it possible to dynamically create series mappings based on the data I receive?
My data comes to me in this form:
public class ReportData
{
public List<QueryResult> QueryResults { get; set; }
}
public class QueryResult
{
public DateTime DataDate { get; set; }
public List<QueryComponent> DataItems { get; set; }
}
public class QueryComponent
{
public DateTime DataDate { get; set; }
public string ItemName { get; set; }
public double ItemValue { get; set; }
}
What I am trying to do is bind this data to a chart where there are several series. Each series is based on the "ItemName". For example List<QueryComponent> is going to have several DataItems with the ItemName "Cars" and I want that to become a series in the chart. ItemName can have many different values (i.e. Cars, Trucks, Bikes, People, Cats, Dogs, etc) and I do not know all of them.
Is it possible to dynamically create series mappings based on the data I receive?