Click here to Skip to main content
15,921,837 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
function retStartDate() {
var strStartDate = document.getElementById("from_date").value;
//alert("Start date " + strStartDate);
return strStartDate;
}


function retEndDate() {
var strEndDate = document.getElementById("to_date").value;
//alert("End date " + strEndDate);
return strEndDate;
}

/*-----------------From Dashboard.html ----------------*/

        function drawTable6() {

                    var strWsUrl = 'https://www.googleapis.com/analytics/v3/data/ga?ids=ga%3A76546294&dimensions='+ 'ga%3Asource&metrics=ga%3Ausers&sort=-ga%3Ausers&start-date='+retStartDate()+'&end-date='+retEndDate()+'&max-results=10';
                    formData = {
                    'Email': 'clientlink@client.com',
                    'Password': 'password',
                    'URL': strWsUrl

                };
                    $.ajax({
                    url: "/APIWebService.asmx/AnalyticsDataShowWithPost",
                    type: 'POST',
                    data: formData,

                complete: function(data) {
                var responseText = data.responseText;
                var responseJson = JSON.parse(responseText.match(/[{].*.[}]/));
                console.log("This is empty !");

                //alert(JSON.stringify(responseJson)); //or just `responseJson` if you skip `JSON.parse`
                console.log(JSON.stringify(responseJson));

                Load(responseJson);

                drawTable6();

                console.log("This is the Load() function");

                var data = new google.visualization.DataTable(responseJson);
                data.addColumn('string', 'Name');
                data.addColumn('string', 'Count');

                data.addRows(responseJson.rows);

                var table = new google.visualization.Table(document.getElementById('table_div6'));
                table.draw(data, { showRowNumber: false });

        }
                });
}

function Load(responseJson){


    }

/*------------New Function to create all required queries.----------------------*/
/*------------------Not Chiranthaka ---------------------*/

/** Start of BarChart(inData) ***/
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900