Good day.

Faced the problem of displaying graphs on the page I'm trying to connect Highcharts via json, but I can't understand where and how to process the data received from the json request. Or maybe there are some other ways to display graphs.

I would be grateful for any help.

    2 answers 2

    var myObject = eval('(' + JSONtext + ')'); 

    After this line, myObject will get all the properties described in JSONtext. I understand that there is no problem getting this text?

    • Thank! Understood. eval () was only one of the problems)) - Aleksey Prague

    Excellent flot library.
    I will give an example from my code

     $(document).ready( function () { $.plot($('#profile_life_activity'), [{data: profile_life_activity, lines: {show: true}, points: {show: true}, color:'#008bd6'}, {data: user_profile_life_activity, lines: {show: true}, points: {show: true}, color:'#e7371f'}, {data: intersection, lines: {show: false}, points: {show: true}, color:'#00ff00'} ], { grid: { hoverable: true, clickable: true }, yaxis: {min: 0, ticks: 9, max: 9}, xaxis: {ticks: 7} }); }); 

    where the data just gets a JSON object

    • Thank. but I still did in Highcharts. And JSON received via ajax - Aleksey Prague