This is a migrated thread and some comments may be shown as answers.

Kendo UI Chart - Visualize count of returned JSON fields

1 Answer 217 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Moses
Top achievements
Rank 1
Moses asked on 29 Jun 2016, 02:50 PM
I want to display the counts of specific retrieved fields in my pie/donut chart.
I'm retrieving data via REST and the result is in json format. The source is a list repeating values:
 
 
     Example: In the following list, I'd like to get a present the number (count) of completed responses; perhaps in a second chart present the breakdown of responses by location.
 
    var userResponse  = [
          {     User:  "Bob Smith", Status: "Completed", Location: "USA" },
          {     User:  "Jim Smith", Status: "In-Progress", Location: "USA" }, 
         {     User:  "Jane Smith", Status: "Completed", Location: "USA" },
         {     User:  "Bill Smith", Status: "Completed", Location: "Japan" },
         {     User:  "Kate Smith", Status: "In-Progress", Location: "Japan" },
         {     User:  "Sam Smith", Status: "In-Progress", Location: "USA" },
     ]
 
======
 
My Initialization currently looks like this:
 
 

$('#targetChart').kendoChart({

    dataSource: {

        data: data.d.results,

        group: {

            field: "Location",

        },

    },

    seriesDefaults: {

        type: "donut",

    },

    series: [{

        field: 'Id',

        categoryField: 'Location',

    }],

});

1 Answer, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 01 Jul 2016, 02:40 PM
Hi Moses,

If I understand correctly you would like to group the data by Location and display the status count? Following the approach from this how-to should help to achieve this. For your convenience here is a dojo - please check it and let me know if I am missing something.

Regards,
Iliana Nikolova
Telerik
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
Tags
Charts
Asked by
Moses
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Share this question
or