<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/style.css">
<!--Load the AJAX API-->
<!--eNPS-->
<script type="text/javascript">
// Load the Visualization API and the piechart package.
google.charts.load('current', {'packages':['corechart']});
// Set a callback to run when the Google Visualization API is loaded.
google.charts.setOnLoadCallback(drawEnpsChart);
// Set a callback to run when the Google Visualization API is loaded.
google.charts.setOnLoadCallback(drawCnpsChart);
// Callback that creates and populates a data table,
// instantiates the pie chart, passes in the data and
// draws eNPS
function drawEnpsChart() {
var queryString_enps = encodeURIComponent('select A,B');
query_enps.send(handleSampleDataQueryResponse);
//From share option in google sheet
function handleSampleDataQueryResponse(response) {
if (response.isError()) {
alert('Error in query: ' + response.getMessage() + ' ' + response.getDetailedMessage());
return;
}
var data = response.getDataTable();
var chart = new google.visualization.LineChart(document.getElementById('chart_div_enps'));
chart.draw(data, {
height: 400,
title: 'eNPS',
animation:{
startup: true,
duration: 1000,
easing: 'out',
},
});
}
}
// Callback that creates and populates a data table,
// instantiates the pie chart, passes in the data and
// draws cNPS
function drawCnpsChart() {
var queryString_cnps = encodeURIComponent('select A,B');
query_cnps.send(handleSampleDataQueryResponse);
//From share option in google sheet
function handleSampleDataQueryResponse(response) {
if (response.isError()) {
alert('Error in query: ' + response.getMessage() + ' ' + response.getDetailedMessage());
return;
}
var data = response.getDataTable();
var chart = new google.visualization.LineChart(document.getElementById('chart_div_cnps'));
chart.draw(data, {
height: 400,
title: 'cNPS',
animation:{
startup: true,
duration: 1000,
easing: 'out',
},
});
}
}
</script>
</head>
<body>
<div>
<!--Div with cNPS chart-->
<div id="chart_div_enps"></div>
</div>
<div>
<!--Div with cNPS chart-->
<div id="chart_div_cnps"></div>
</div>
</body>