Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
515
XamDataChart - Bind to List of Dictionary
posted

I have a situation in which a reporting service returns generic lists of data as List<Dictionary<string, object>>, where string is the column/data member name I wish to bind to, and object is the value/data point.

Is it possible to bind such a data source to the XamDataChart X and Y Axis definitions?

Here's an example of what the data source would return:

public static List<Dictionary<string, object>> GetDictionarySource()

{

    List<Dictionary<string, object>> list = new List<Dictionary<string, object>>();

 

    var d = new Dictionary<string, object>();

    d.Add("Name", "blah");

    d.Add("YValue1", 80000);

    d.Add("YValue2", 75000);

    list.Add(d);

 

    d = new Dictionary<string, object>();

    d.Add("Name", "blah1");

    d.Add("YValue1", 70000);

    d.Add("YValue2", 65399);

    list.Add(d);

 

    return list;

}

Thanks.

 

Parents Reply Children