Chart not displaying all category axis values

2 posts, 0 answers
  1. Vaughn Myers
    Vaughn Myers avatar
    5 posts
    Member since:
    Apr 2006

    Posted 15 Jul 2013 Link to this post

    My JSON object returns data similar to this: 
    Count   Group    Num    year
    16         Group1     1         2013
    15         Group1     2         2013
    21         Group1     3         2013
    34         Group1     4         2013
    12         Group1     5         2013
    30         Group2     1         2013
    23         Group2     2         2013
     
    In the area chart I group by field [Group]. When it's rendered in the chart, the category (horizontal) axis (Field [Num]) only displays values 1 & 2, since Group2 only has [Num] 1 & 2. What would I need to do to display the [Num] from Group1? Group 1 will will always have 5 [Num].
     
    A fix is to add 3 more rows to 'fill' what's missing from Group2 (3, 4, 5), but that's not really a solution.
     
    Thanks.
  2. Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    2622 posts

    Posted 16 Jul 2013 Link to this post

    Hi Vaughn,

    The observed behavior is due to different number of data points. Please keep in mind by design categoryAxis.labels in grouped chart are created depending on the first group. Also the categorical charts (area, line, bar, column) require a matching set of data points - the value can be null but the record needs to be presented in the data (this is because series.data is a simple array). Hence in order to get the expected result you should add the missing points into the Group2. We realize this is not the most perfect solution and will do our best to provide a better approach for future releases. 

    Regards,
    Iliana Nikolova
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top