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
No Data
Reply
  • 30692
    Offline posted

    I believe you can do something like this is recent versions of the chart 

    ValueMemberPath="[YValue1]" 

    etc.

    But I don't recall currently which version this functionality was added in. 11.1 possibly, or possibly pending for 11.2. Will have to verify. Give it a try if you are running 11.1

    -Graham

Children