TOP N grouped Bar Chart

2 posts, 0 answers
  1. Fabrizio
    Fabrizio avatar
    16 posts
    Member since:
    Nov 2013

    Posted 19 Jul 2016 Link to this post

    Hi, I would like to do a "Top 4" ordered Bar Chart but I cannot sort the grouped value results and include only the best 4 values

    (I do not sum values but I just count the items in each group)

    see the Dojo Code



  2. Alex Hajigeorgieva
    Alex Hajigeorgieva avatar
    317 posts

    Posted 21 Jul 2016 Link to this post

    Hi Fabrizio,

    To achieve the desired functionality, get the data in the desired format beforehand. Such functionality is not built-in; the Kendo UI Data Source only uses what is available in its data() collection: 

    Below are some suggested steps:

    - Use the fetch() Kendo UI Data Source method and map the current view in a callback function:

    - To be able to sort the Kendo UI Data Source by the length of the groups, save the length in a property. ("GroupSize" in our case).

    - Assign the colour to another new property otherwise, only the first colour will be used.

    With the above steps complete, the data array can be used to achieve the requirement.

    - Sort by GroupSize
    - Apply pageSize : 4

    For your convenience, I am including a Dojo sample completing the above. It is available at:

    Telerik by Progress
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
Back to Top