last day (14 days later) » 

9:03 AM
Hi
 
Hey
I think the issue is just with the parsing of the json
 
Or creating new json array
Can you send me a screenshot with the response from console ?
 
Sure sending one now
 
9:18 AM
I see that you return from server one single object
with multiple properties
how looks your server-side function ?
 
Essentially like this
`public function pieChartData(Request $request) {

return response()->json(['positive' => 94,
'negative' => 3,
'neutral' => 3
]);
}`
 
well, we need to create json data for chart
please wait 2 min..i will give you a solution
 
thanks. just to let you know I am using laravel 5.3. I am happy to format the json response differently if needed
 
Can you send a json array ?
 
from backend to front end? sure. But I would prefer to keep the backend response the same and modify in the jQuery/javascript to work in the chart. As I am using this response in other places
 
9:31 AM
ok..sure
Do you have teamviewer ? To help you quickly.
 
Sorry I don't have team viewer. Maybe if we could do something like this:
$.each( data, function( key, value ) {
array.push('{ name:'+key+', y:'+value+' },');

});
 
thanks let me try that
 
and "object" will be response you received from server now
 
thanks a lot that worked :). Please post this as the answer and I will accept
 
9:38 AM
you're welcome
i will post in 1 minute.
 
sure. Let me know whenever you do and I will accept
 
thanks again, I accepted and up-voted
 
see ya
 

last day (14 days later) »