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
1415
AutoGenerateSeries
posted

How can I dynamically create a stacked column series?  I'm setting AutoGenerateSeries="true", but unable to find where I can define the KeyMemberPath or ValueMemberPath.  Also, I don't need to use the ig:GroupBy resource because we already calculate the totals in SQL before it hits the app. Is there another resource setting I can create to assign these objects appropriately? 

Parents
  • 34830
    Verified Answer
    Offline posted

    Hello PMac,

    Auto-generation in the StackedColumnSeries requires the usage of a GroupBy ItemsSource, as the StackedColumnSeries does not have an inbuilt KeyMemberPath or ValueMemberPath.

    Instead, when using a traditional list of objects, you are expected to populate the StackedColumnSeries.Series collection with StackedFragmentSeries objects. These StackedFragmentSeries objects have a ValueMemberPath property that you can set corresponding to the underlying data items that exist in the collection used for your ItemsSource. The "Key" in this case will correspond to the category which is bound to your CategoryXAxis' Label property. For example, if you had a Label setting in your CategoryXAxis of "{}{Country}," the key would be the underlying Country property on the data items that are bound to the ItemsSource of your chart.

    So, in order to dynamically create a StackedColumnSeries, I would recommend looping through each of the properties that you are looking to create a column fragment for, create a StackedFragmentSeries for each, and add it to the StackedColumnSeries.Series collection.

    I hope this helps. Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Associate Developer

Reply Children