In the RadChart examples on the Telerik website, the data supplied to the charts is structured as value pairs (i.e. Month – TotalSales). This allows simple and straightforward data displaying by mapping one field to XCategory and another to YValue. Essentially the data comes with some pre-aggregation already done.
In our application the chart data are supplied in raw form as the set of items having {field_1, field_2, … ,field_n} therefore the aggregation is required for achieving any meaningful data representation; otherwise the chart will create separate bar for each dataset item with only numeric fields suitable for mapping to the Y axis. Furthermore we want to take advantage of the built-in RadChart aggregation to have flexible user interface that allows data presentation in different profiles.
However the use of aggregation had some undesired effects we have not been abe to overcome, please advise what would be our best solution:
Scenario 1.
The aggregation is applied to one of the fields of the data item; that field is mapped as XCategory, another field is mapped as YValue with the desired aggregation function.
The X axis is broken into segments according to actual amount of groups for the group-by field. The bar representing the aggregated value is drawn within each segment with the label placed under the segment. The problem is that the bar does not occupy the entire width of allocated segment and positions differently for each segment. Apparently despite the fact that each segment should represent only one group it still allocates inside the space for the bars representing all groups however only the relevant bar is displayed.
Scenario 2.
The aggregation is applied to one of the fields of the data item however unlike the Scenario 1 that field is mapped as LegendLabel, another field is mapped as YValue with the desired aggregation function.
The appearance of the bars has improved, they occupy more chart space however the X axis is no longer broken into group segments and the group labels are no longer displayed under the bars. Instead bars are placed into one section without the gap having strange label “1” underneath.
Scenario 3.
As the workaround a fake constant field has been added to the data item and fake aggregation on that field has been set for the chart. The idea behind that fake aggregation on constant field was to ensure that its results always get into single group. Also like in secenario 1 the actual aggregation was applied to one of the fields of the data item; that field was mapped as XCategory, another field was mapped as YValue with the desired aggregation function.
The X axis is broken into group segments with the labels underneath. The bars evenly occupy the space within their segments. The problem is that all bars are painted in the same colour and the legend does not show what is represented by each bar.
Is there any solution for this situation; is there way to achieve something like combination of the results 1 (colours and legend) and 3 (bars alignment).