Hello ,
I want to take dynamically array value in High chart,
I have created following code , Here I am retrieving value from SharePoint list And according to that values I need to develop a graph So what I can do for That?
So Please help provide me any answer...
........Something Code above.......
$().SPServices({
operation: method,
async: false,
listName: list,
CAMLViewFields: fieldsToRead,
CAMLQuery: query,
completefunc: function (xData, Status) {
$(xData.responseXML).SPFilterNode("z:row").each(function() {
var Name = ($(this).attr("ows_Title"));
var Salary = ($(this).attr("ows_Salary"));
var iID=$(this).attr("ows_ID");
AddRowToTable(Name ,Salary ,iID);
});
}
});
}
function AddRowToTable(Name ,Salary ,iID)
{
alert(Salary);
$.getJSON("arr", function AddRowToTable(Name ,Salary ,iID) {
$('#courseTable').highcharts({
title: {
text: 'Monthly Average Salary',
x: -20
},
subtitle: {
text: '',
x: -20
},
xAxis: {
categories:[''+Name+'']
},
yAxis: {
title: {
text: 'Salary (RS)'
},
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}]
},
tooltip: {
valueSuffix: 'Rs'
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'middle',
borderWidth: 1
},
series: [{
name: [''+Name+''],
data: JSON.parse("[" + Salary+ "]")
}]
});
});
};
</script>
[EDIT]Please, use code formatting. Thank you. Maciej Los[/EDIT]