I have a problem in binding JSON data to KENDO Pie Chart.
I have a service that return me JSON data from server and URL of my Service is as follow
url: “/DomainService/CompanyProfileDomainService.svc/json/GetCompanyProfileContactedViews”
when i paste this link in the firefox i get the following JSON data
{"GetContactedChartViewsResult":{"TotalCount":3,"RootResults":[
{"ContactedID":1,"ContactedName":"No","Occurances":5},
{"ContactedID":2,"ContactedName":"Under Consideration","Occurances":1},
{"ContactedID":3,"ContactedName":"Follow Up","Occurances":11}]}}
I only need “Occurances” from JSON and I am really struggling how to get it.
One option in my mind is to make an array in which i can inject all the “Occurances” and than bind that array to the Pie Chart but i dont know how to make this array from JSON as i am very much new to the JQuery.
Could please anyone help me to get me problem sorted. Many Thanks.
To populate an array using JQuery I would use $.get to retrieve the data then use $.each to iterate over the object array. After the asynch operation has completed arrayOfValues should contain all the occurances.