I'm trying to create a user control with RadChart and an expandable RadGridView underneath capable of attaching to any data source. That is, I can attach the entire control to any DataTable source, without knowing anything about the source (columns, datatypes, etc.) until runtime.
The chart provides metrics, while the grid underneath exposes the underlying data to the user, allowing them to sort and filter what is displayed on the chart. To that end, I'm binding both the grid and the chart to a QueryableCollectionView, which has been working well enough.
My problem is that all of my data is categorical and that combinations of columns could potentially produce a category. That is, I may have two fields providing categories, such as "Year" and "FirstName", and then one field providing Y Values, such as "Distance". In this example I would want my X categories to be "2010 - James", "2011 - James", "2010 - Mark", etc. or some combination of those fields. In theory, I could make a calculated column in my data source with this formatting, for the label, but the problem is more complex...
Ideally, I also want to give the user control over these groupings. I understand how to give my series various aggregation functions for the values, and RadChart seems to handle the values just fine. But if a user selects a grouping on "Year" in the above example, I would want the chart to instead display "2010", "2011" with series values calculated according to the grouping function. If I had a calculated column underneath my data, I would need to update this expression according to what fields the user had selected to group on.
So: Is that calculated column the only approach to this or is there something a little less complicated for handling multi-category data?
A couple notes:
The chart provides metrics, while the grid underneath exposes the underlying data to the user, allowing them to sort and filter what is displayed on the chart. To that end, I'm binding both the grid and the chart to a QueryableCollectionView, which has been working well enough.
My problem is that all of my data is categorical and that combinations of columns could potentially produce a category. That is, I may have two fields providing categories, such as "Year" and "FirstName", and then one field providing Y Values, such as "Distance". In this example I would want my X categories to be "2010 - James", "2011 - James", "2010 - Mark", etc. or some combination of those fields. In theory, I could make a calculated column in my data source with this formatting, for the label, but the problem is more complex...
Ideally, I also want to give the user control over these groupings. I understand how to give my series various aggregation functions for the values, and RadChart seems to handle the values just fine. But if a user selects a grouping on "Year" in the above example, I would want the chart to instead display "2010", "2011" with series values calculated according to the grouping function. If I had a calculated column underneath my data, I would need to update this expression according to what fields the user had selected to group on.
So: Is that calculated column the only approach to this or is there something a little less complicated for handling multi-category data?
A couple notes:
- The chart itself does not seem to natively support multi-category axes, since if I create two ItemMappings both with DataPointMember.XCategory, RadChart will only use the last one. If this is an option, that would be great.
- Could I use RadGridView's grouping panel to do the grouping? I may have something set up incorrectly but even if I provide grouping functions for the GridView, when I group the GridView, the Chart displays a single series of data points with 0 as the YValue.