Hi,
I am new to Google charts and facing a strange issue on using it.
Problem:
I have used an ajax call to retrieve data for Organizational Chart. *Problem
is that I am having some important values stored in Session which are not
accessible after this ajax call* i.e. the reference to those parameters is
becoming null.
Please see the below code which I am using to draw my chart. Kindly help me
if someone has idea that why my session is clearing after this Code
Execution!
google.charts.load('current', { packages: ["orgchart"] });
google.charts.setOnLoadCallback(drawChartApplicationSpecific);
function drawChartApplicationSpecific() {
var pagePath = window.location.pathname;
$.ajax({
type: "POST",
url: pagePath + "/GetOrgDataListObject",
data: {},
contentType: "application/json; charset=utf-8",
dataType: "json",
success: OnSuccess_getOrgData,
error: OnErrorCall_getOrgData
});
function OnSuccess_getOrgData(repo) {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Name');
data.addColumn('string', 'Manager');
data.addColumn('string', 'ToolTip');
var response = repo.d;
for (var i = 0; i < response.length; i++) {
var row = new Array();
var empName = response[i].Employee;
var mgrName = response[i].Manager;
var empID = response[i].empID;
var mgrID = response[i].mgrID;
var designation = response[i].designation;
var image = response[i].imagePath;
data.addRows([[{
v: empID,
f: empName + "<div style='color:red;
font-style:italic'>" + designation + "</div><br/><img
style='height:50px;width:50px;' src=" + image + " /><br/>"
}, {
v: mgrID,
f: mgrName
}, designation]]);
}
var chart = new
google.visualization.OrgChart(document.getElementById('chart_div'));
chart.draw(data, { allowHtml: true, size: 'small' });
}
function OnErrorCall_getOrgData() {
alert("Whoops something went wrong :( ");
}
}
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-visualization-api/811d8f3d-c73f-4251-a0fa-a765cbd8934a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.