When i run the code above it gives me an alert. It says undefined
Error: Authentication failed
<script type="text/javascript">
google.load("visualization", "1", { packages: ["corechart"] });
google.setOnLoadCallback(drawChart);
function drawChart() {
var options = {
title: 'Number Of Resources',
width: 600,
height: 400,
bar: { groupWidth: "95%" },
legend: { position: "none" },
isStacked: true
};
$.ajax({
type: "POST",
url: "dashboard/GetChartData",
data: '{}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (r) {
var data = google.visualization.arrayToDataTable(r.d);
var chart = new google.visualization.PieChart($("#chart")[0]);
chart.draw(data, options);
},
failure: function (r) {
alert(r.d);
},
error: function (r) {
alert(r.d);
}
});
}
</script>