Here's a link to one of the examples of google charts, chartEditor class to be specific : https://developers.google.com/chart/interactive/docs/reference#example_7 and here's the code itself:



 
 
    Google Visualization API Sample
 
 
 
    google.load('visualization', '1.0', {packages: ['charteditor']});
 
 
    google.setOnLoadCallback(loadEditor);
    var chartEditor = null;

    function loadEditor() {
      // Create the chart to edit.
      var wrapper = new google.visualization.ChartWrapper({
         'chartType':'LineChart',
         'dataSourceUrl':'http://spreadsheets.google.com/tq?key=pCQbetd-CptGXxxQIG7VFIQ&pub=1',
         'query':'SELECT A,D WHERE D > 100 ORDER BY D',
         'options': {'title':'Population Density (people/km^2)', 'legend':'none'}
      });

      chartEditor = new google.visualization.ChartEditor();
      google.visualization.events.addListener(chartEditor, 'ok', redrawChart);
      chartEditor.openDialog(wrapper, {});
    }

    // On "OK" save the chart to a on the page.
    function redrawChart(){
      chartEditor.getChartWrapper().draw(document.getElementById('vis_div'));
    }

 


 






In the above code, inside the function loadEditor() I want to pass data in the form of JSON instead of url. How can I achieve that? Thank You...