As a result, RadChart creates six series - per one for each of the groups. When visualized in RadChart, the data from the table above will look similar to the one from the image below:Īs you can see, when the data is grouped by Year and Region, six groups will be created: three groups for the three regions for year 2008 and three groups for the three regions for year 2009. ( seriesMapping ) Dim radChart As New RadChart() '.' Dim seriesMapping As New SeriesMapping() seriesMapping.SeriesDefinition = New BarSeriesDefinition() (New ChartGroupDescriptor("Year")) (New ChartGroupDescriptor("Region")) (New ItemMapping("Value", DataPointMember.YValue)) (New ItemMapping("Description", DataPointMember.XCategory)) '.' (seriesMapping) SeriesMapping seriesMapping = new SeriesMapping() seriesMapping.SeriesDefinition = new BarSeriesDefinition() ( new ChartGroupDescriptor( "Year" ) ) ( new ChartGroupDescriptor( "Region" ) ) ( new ItemMapping( "Value", DataPointMember.YValue ) ) ( new ItemMapping( "Description", DataPointMember.XCategory ) ) //. In order to use the grouping feature, you have to declare the following namespace: The following example, considering the sample data above, demonstrates how to use grouping with bar chart: You cannot group or aggregate when DataSeries and DataPoints are used. To use grouping and aggregation functionality you need data binding via SeriesMapping/ItemMapping. ShouldCreateSeriesForLastGroup - specifies whether or not a series to be created for the last group. GroupDescriptors - a collection of ChartGroupDescriptor s, one for each property from the underlying data which you want to group by. It is of type GroupingSettings and has the following properties: Use SeriesMapping.GroupSettings to define the groups. RadChart allows you to define grouping and aggregation for each series separately. As a result, for each group you will have one value: the sum of all Apples and Bananas consumed for the concrete year and region. Note how the values for each group (Year, Region) are calculated - as a sum of all the items in the group. The table below shows the data when the grouping and the Sum aggregate function are applied. Sometimes grouping data is enough, but often you might need to apply aggregate function like Sum or Count. If you group it by Year and Region, you will have this: Year Understanding Grouping and AggregationĬonsider the following data for Apple and Banana consumption in thee regions for years 20: YearĪs you can see, the data is not grouped. Using the specified criteria, RadChart will first process and group the data and second, will create as many series as needed in order to visualize the groups properly. RadChart allows you to create charts showing the data grouped by one or more criteria. Grouping is a process which groups the data by one or more parameters. This is a very powerful way to build charts that let you summarize business data in seconds. Which means that you can group the underlying data and apply one of the supported aggregation functions. RadChart supports grouping and aggregation. Controls / RadChart / Features / Grouping Grouping and Aggregation
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |