How to use subgrid with Jqgrid and JSON? - json

I'm a jqrid newbie. My problem is how to make it work using subgrid? This is the js file :
var url = $.url(window.location.href.replace("#",""));
var page = url.param("page");
var sortname = url.param("sortname");
var sortorder = url.param("sortorder");
jQuery("#list2").jqGrid({
url:'/taskuri/json/',
datatype: "json",
colNames:['Pri','Proiect','','Task', '', 'Responsabil','Alocator', 'Alocat', 'Deadline','Estimat','Lucrat',''],
colModel:[
{name:'priority',index:'priority', width:'3%', editable: true, editoptions:{size:"1",maxlength:"1"}},
{name:'project',index:'project', width:'7%'},
{name:'finished',index:'finished', width:'2%'},
{name:'section',index:'section', width:'38%'},
{name:'projectid',index:'projectid',hidden:true},
{name:'user',index:'user', width:'7%', editable: true,edittype:'select',editoptions:{value:getUsers }},
{name:'assignerid',index:'assignerid', width:'7%'},
{name:'created',index:'created', width:'6%', editable:true},
{name:'deadline',index:'deadline', width:'6%', editable:true},
{name:'estimated',index:'estimated', width:'4%', editable:true, align:'right'},
{name:'worked',index:'worked', width:'5%',align:'right', align:'right'},
{name:'remove',index:'remove', width:'3%', sortable:false}
],
rowNum:100,
sortname: (sortname != null) ? sortname : 'taskid',
viewrecords: true,
sortorder: (sortorder!=null) ? sortorder : "desc",
caption:"",
autowidth: true,
shrinkToFit: true,
height:'auto',
//width: '100%',
scroll:false,
scrollOffset:0,
//height: '100%',
altRows: true,
altClass: '',
page: (page!=null)? page: 1,
footerrow : true,
userDataOnFooter: true,
subGrid : true,
subGridUrl: '/taskuri/subGrid/',
subGridModel: [{ name : ['Test1','Test2'],width : [55,200,80,80,80] } ],
loadComplete:function(request){
$('#totalRows').html(request.total + " rezultate");
$("[aria-describedby='list2_section']", this).contextMenu('myMenu1',{
onContextMenu: function(e) {
var rowId = $(e.target).closest("tr.jqgrow").attr("id");
var projectName = $('#list2').jqGrid('getCell',rowId,'project');
var taskName = $('#list2').jqGrid('getCell',rowId,'section');
var regex = /<a.+>(.+)\<\/a>/;
var result = taskName.match(regex)[1];
//if($(e.target).closest('a').attr("class"))
//{
$("#addSubTask").click(function(){
$('#proiectName').val(projectName);
$('#taskName').val(result);
$("#adsubtaskdialog").dialog({show:"slow", title: "Adaugare SubTask",
resizable: true, width:337
});
});
//$("#addSubTask").html('<a href="/timp/editSubtask/?action=start&projectName='+projectName+'&taskName='+result+'" class="addTime" >Adauga SubTask</a>');
$("#send").html('<a onclick="send_email('+rowId+')">Trimite email de reamintire</a>');
return true;
//}
//else
// return false;
}
});
$("#paging").html(request.userdata.pager);
$(".numb").click(function() {
$("#list2").trigger("reloadGrid", [{page:$(this).text()}]);
});
doPagination();
showConfirm();
formatUrl();
setBackUrl();
$("#empty").hide();
if(request.total == 0)
$("#empty").show();
registerOverlay();
//footer row hack
$(".ui-jqgrid-sdiv").width('auto');
$(".ui-jqgrid-ftable").css("margin-top",0);
},
..........
where taskuri/subGrid/ (taskuri is a controller) and subGrid(is a function). Im using Codeigniter. The function has the following code :
$this->load->library('JSON');
$examp = $_GET["q"]; //query number
$id = $_GET['id']; // connect to the database
$query = "SELECT taskid,name, deadline
FROM tasks
WHERE taskid='8516'
ORDER BY taskid";
$result = mysql_query($query);
$i =0 ;
while($row = mysql_fetch_array($result)) {
$response->rows[$i]=$row;
$i++;
}
echo json_encode($response);
Im totally confused. Can anyone help me with this ? This is a picture how does it look like:

Related

Add Information to Google Timeline bar Hover

I'm trying to add three new sections to the hover pop-up on a bar in google timeline charts.
I have tried using the google timeline help but cannot find a solution
The default is Title / Time / Duration, however I want to add Arena / Website
I have created the below code for this as an example.
<DIV>
<p><font face="verdana" size="6" color="Black">Thursday</font></p>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
google.charts.load("current", {packages:["timeline"]});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var container = document.getElementById('example5.1');
var chart = new google.visualization.Timeline(container);
var dataTable = new google.visualization.DataTable();
dataTable.addColumn({ type: 'string', id: 'Federation' });
dataTable.addColumn({ type: 'string', id: 'Event' });
dataTable.addColumn({ type: 'date', id: 'Start' });
dataTable.addColumn({ type: 'date', id: 'End' });
dataTable.addRows([
[ 'WWE / NXT', 'AXXESS', new Date(0,0,0,18,0,0), new Date(0,0,0,22,0,0)],
[ 'WWN', 'Matt Riddles Bloodsport', new Date(0,0,0,15,0,0), new Date(0,0,0,18,0,0)],
[ 'WrestleCon', 'Wildkat Sports', new Date(0,0,0,18,0,0), new Date(0,0,0,21,0,0)],
[ 'WWN', 'Evolve', new Date(0,0,0,20,00,0), new Date(0,0,0,23,0,0)],
[ 'WrestleCon', 'WrestleCon Supershow', new Date(0,0,0,21,30,0), new Date(0,0,0,23,30,0)],
[ 'Knockout', 'Knockout in NOLA', new Date(0,0,0,17,00,0), new Date(0,0,0,20,00,0)],
[ 'ROH', 'RoH Supercard of Honor', new Date(0,0,0,19,30,0), new Date(0,0,0,22,30,0)],
[ 'WWN', 'Beyond Wrestling', new Date(0,0,0,20,55,0), new Date(0,0,0,23,55,0)]]);
var options = {
timeline: { colorByRowLabel: true },
tooltip: {isHtml: true},
legend: 'none',
backgroundColor: '#ffd'
};
chart.draw(dataTable, options);
}
</script>
<div id="example5.1" style="height: 300px;"></div>
</DIV>
you can add your own custom tooltip, see Customizing tooltips in the Timeline reference
the tooltip column will just be a string, either a simple value or html
see following working snippet,
here, a DataView is used to add the tooltip column.
this allows the tooltip to be built dynamically based on the data in the data table
also, the arena is added to the original data table, for easy reference,
but is excluded from the data view...
google.charts.load('current', {
packages: ['timeline']
}).then(function () {
var container = document.getElementById('example5.1');
var chart = new google.visualization.Timeline(container);
var dataTable = new google.visualization.DataTable();
dataTable.addColumn({ type: 'string', id: 'Federation' });
dataTable.addColumn({ type: 'string', id: 'Event' });
dataTable.addColumn({ type: 'date', id: 'Start' });
dataTable.addColumn({ type: 'date', id: 'End' });
dataTable.addColumn({ type: 'string', id: 'Arena' });
dataTable.addRows([
['WWE / NXT', 'AXXESS', new Date(0,0,0,18,0,0), new Date(0,0,0,22,0,0), 'Arena A'],
['WWN', 'Matt Riddles Bloodsport', new Date(0,0,0,15,0,0), new Date(0,0,0,18,0,0), 'Arena B'],
['WrestleCon', 'Wildkat Sports', new Date(0,0,0,18,0,0), new Date(0,0,0,21,0,0), 'Arena C'],
['WWN', 'Evolve', new Date(0,0,0,20,00,0), new Date(0,0,0,23,0,0), 'Arena D'],
['WrestleCon', 'WrestleCon Supershow', new Date(0,0,0,21,30,0), new Date(0,0,0,23,30,0), 'Arena E'],
['Knockout', 'Knockout in NOLA', new Date(0,0,0,17,00,0), new Date(0,0,0,20,00,0), 'Arena F'],
['ROH', 'RoH Supercard of Honor', new Date(0,0,0,19,30,0), new Date(0,0,0,22,30,0), 'Arena G'],
['WWN', 'Beyond Wrestling', new Date(0,0,0,20,55,0), new Date(0,0,0,23,55,0), 'Arena H']]);
var options = {
timeline: { colorByRowLabel: true },
tooltip: {isHtml: true},
legend: 'none',
backgroundColor: '#ffd'
};
var formatTime = new google.visualization.DateFormat({
pattern: 'HH:mm:ss a'
});
var view = new google.visualization.DataView(dataTable);
view.setColumns([0, 1, {
role: 'tooltip',
type: 'string',
calc: function (dt, row) {
// build tooltip
var dateBegin = dt.getValue(row, 2);
var dateEnd = dt.getValue(row, 3);
var oneHour = (60 * 60 * 1000);
var duration = (dateEnd.getTime() - dateBegin.getTime()) / oneHour;
var tooltip = '<div><div class="ggl-tooltip"><span>';
tooltip += dt.getValue(row, 0) + ':</span> ' + dt.getValue(row, 1) + '</div>';
tooltip += '<div class="ggl-tooltip"><div>' + formatTime.formatValue(dateBegin) + ' - ';
tooltip += formatTime.formatValue(dateEnd) + '</div>';
tooltip += '<div><span>Duration: </span>' + duration.toFixed(0) + ' hours</div></div>';
tooltip += '<div class="ggl-tooltip"><span>Arena: </span>' + dt.getValue(row, 4) + '</div></div>';
return tooltip;
},
p: {html: true}
}, 2, 3]);
chart.draw(view.toDataTable(), options); // <-- use data view to draw chart
});
.ggl-tooltip {
background-color: #ffffff;
border: 1px solid #e0e0e0;
font-family: Arial, Helvetica;
font-size: 14px;
padding: 8px;
}
.ggl-tooltip span {
font-weight: bold;
}
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<div id="example5.1"></div>

Set combobox in dojo datagrid cell depands on value type

Can anybody help me how to set Combobox in DataGrid (dojox/grid) cells programmatically for each cell in column separately?
Structure parameter: cellType does its job, but all cells in column inherit defined type.
With formatter function we can return Combobox object but it has different behaviour then Combobox inserted with cellType.
I'm thinking also about onStartEdit function but I do not have idea how to implement that.
What I want to achieve is that if in cell is value which is text then I want to show combobox with all possibilities. In case of value as a number than I don't want to show combobox at all.
Sample code: (Dojo version 1.9.11)
require([
"dojo/data/ItemFileReadStore",
"dojo/store/Memory",
"dojox/grid/DataGrid",
"dojo/data/ObjectStore",
"dojo/dom",
"dojo/dom-construct",
"dijit/form/ComboBox",
"dojox/grid/cells/dijit",
"dojo/dom-style",
"dojo/domReady!"],
function(ItemFileReadStore, Memory, DataGrid, ObjectStore, dom, domConstruct, ComboBox, dijit, domStyle){
var dataArray = [];
var dataMemory = new Memory({data:dataArray});
var gridStruc = [];
gridStruc.push({name: 'Name', field: 'col1', width: '100px', editable: false});
gridStruc.push({name: 'Type', field: 'col2', width: '100px', editable: false});
gridStruc.push({name: 'Value (cellType)', field: 'col3', width: '100px', editable: true, cellType: 'dojox.grid.cells.ComboBox', options: ["Test1","Test2"]});
gridStruc.push({name: 'Value (formatter)', field: 'col4', width: '100px', editable: true, formatter: formatterCb});
var columnObj0 = {};
columnObj0["col1"] = "Voltage";
columnObj0["col2"] = "Number";
columnObj0["col3"] = "5";
columnObj0["col4"] = "5";
dataMemory.put(columnObj0);
var columnObj1 = {};
columnObj1["col1"] = "Type";
columnObj1["col2"] = "Text";
columnObj1["col3"] = "THT";
columnObj1["col4"] = "THT";
dataMemory.put(columnObj1);
var columnObj2 = {};
columnObj2["col1"] = "Num. Reflow";
columnObj2["col2"] = "Number";
columnObj2["col3"] = "3";
columnObj2["col4"] = "3";
dataMemory.put(columnObj2);
var columnObj3 = {};
columnObj3["col1"] = "Series";
columnObj3["col2"] = "Text";
columnObj3["col3"] = "CBK34";
columnObj3["col4"] = "CBK34";
dataMemory.put(columnObj3);
var dataStore = new ObjectStore({ objectStore: dataMemory});
grid = new DataGrid({
store: dataStore,
structure: gridStruc
},"gridDiv");
grid.startup();
function formatterCb(value, rowIndex, rowItem)
{
var storeItems=[];
storeItems.push({name: "Test1", value: "test1"});
storeItems.push({name: "Test2", value: "test2"});
var store = new ItemFileReadStore({data: {identifier:"name", items: storeItems}});
var w = new ComboBox({
label: "Use Input",
store: store,
value: value
});
w._destroyOnRemove = true;
return w;
}
});
I think defining formatter function may help.
Take a look at this example from documentation
function formatCell(value){
//perform your logic here
}
var layout = [
{
name: 'Cell1',
field: 'id'
},
{
name: 'Cell2',
field: 'date',
formatter: formatCell
}
];
In your case it will be here:
gridStruc.push({name: 'Name', formatter: formatCell, field: 'col1', width: '100px', editable: false});
I have no idea why do you use array.push, but it doesn't matter in this case.
Also check this tutorial, there is an example how to put widget in cell. It may be helpful.

how to group the chart

i want to group this chart like " gender 1" is men and "gender 2" is women, but when i try to code the chart it's difficult to differentiate them.
here is my code
//data.php
<?php
//setting header to json
header('Content-Type: application/json');
//database
define('DB_HOST', '127.0.0.1');
define('DB_USERNAME', 'root');
define('DB_PASSWORD', '');
define('DB_NAME', 'dbintegrasi');
//get connection
$mysqli = new mysqli(DB_HOST, DB_USERNAME, DB_PASSWORD, DB_NAME);
if(!$mysqli){
die("Connection failed: " . $mysqli->error);
}
//query to get data from the table
$query = sprintf("SELECT JenisKelaminID, COUNT(JenisKelaminID) as jumlah FROM tahunmasukmagister GROUP BY JenisKelaminID");
//execute query
$result = $mysqli->query($query);
//loop through the returned data
$data = array();
foreach ($result as $row){
$data[] = $row;
}
//freee memory associated with result
$result->close();
//close connection
$mysqli->close();
//new print the data
print json_encode($data);
//app.js
$(document).ready(function(){
$.ajax({
url: "http://localhost/chartjs/data.php",
method: "GET",
success: function(data) {
console.log(data);
var Gender = [];
var jumlah = [];
for(var i in data){
Gender.push("Gender " + data[i].JenisKelaminID);
jumlah.push(data[i].jumlah);
}
var chartdata = {
labels: Gender,
datasets: [
{
label : 'Gender',
backgroundColor: 'rgba(250, 300, 100, 0.75)',
borderColor: 'rgba(200, 200, 200, 0.75)',
hoverBackgroundColor: 'rgba(200, 200, 200, 1)',
hoverBorderColor: 'rgba(200, 200, 200, 1)',
data: jumlah
}
]
};
var ctx = $("#mycanvas");
var barGraph = new Chart(ctx, {
type: 'bar',
data: chartdata
});
},
error: function(data) {
console.log(data);
}
});
});
please help me to solve this, thankyou
In you app.js file on line number 10 :
Gender.push("Gender " + data[i].JenisKelaminID);
you can set an if condition instead of it Like
if(data[i].JenisKelaminID == 1){
Gender.push("Men");
} else if(data[i].JenisKelaminID == 2){
Gender.push("Women");
} else {
Gender.push("Other");
}
In there the chart name is defined, hope it will help your work.

How do I register the on-tap in a paper-icon-button in an ag-grid cell renderer?

I am working on adding ajax call to paper-icon-buttons that are rendered in an ag-grid cell renderer. Here is the script in my custom polymer component. The paper-icon-buttons do show up and clicking on them causes the ripple, but the functions in the on-tap are not being called.
Is there a better way to add the paper-icon-button entries to the cell? How can I add the registration of the on-tap properly?
Thank you!
<script>
function sourceRenderer(params) {
if (params.value)
return '<span>' + params.value + ''
else
return null;
}
function innerCellRendererA(params) {
var imageFullUrl = '/images/' + params.data.type + '.png';
if (params.data.type == 'entity') {
var entityUrl = '/analyze/' + params.data.asource + '/' + params.data.amodel + '/' + params.data.sourceName;
return '<img src="'+imageFullUrl+'" style="padding-left: 4px;" /> ' + params.data.name + ' (' + params.data.sourceName + ')';
}
else if (params.data.type == 'model') {
var entityUrl = '/harvest/' + params.data.asource + '/' + params.data.name;
return '<img src="'+imageFullUrl+'" style="padding-left: 4px;" /> ' + params.data.name + '';
}
else
return '<paper-icon-button src="'+imageFullUrl+'" on-tap="testjdbc" data-args="'+params.data.classname+'~~'+params.data.url+'~~'+params.data.username+'~~'+params.data.password+'"></paper-icon-button> ' +
'<paper-icon-button src="/images/database_export.svg" on-tap="harvestmodel" data-args="'+params.data.classname+'~~'+params.data.url+'~~'+params.data.username+'~~'+params.data.password+'"></paper-icon-button> ' + params.data.name;
}
Polymer({
is: 'easymetahub-analyze',
properties: {
sourcelist: {
type: Array,
notify: true
}
},
testjdbc: function(e){
alert('Foo');
var args = e.target.getAttribute('data-args').split('~~');
},
harvestmodel: function(e){
alert('Bar');
var args = e.target.getAttribute('data-args').split('~~');
},
handleData: function(e) {
var resp = e.detail.response;
this.sourcelist = resp;
},
ready: function() {
},
attached: function() {
agGrid.initialiseAgGridWithWebComponents();
var columnDefs = [
{
headerName: "Name",
'field': 'name',
width: 350,
cellRenderer: 'group',
sort: "asc",
cellRendererParams: {
innerRenderer: innerCellRendererA
}
},
{headerName: "Database Type", field: "databasetype", width: 120 },
{headerName: "URL", width: 250, field: "url" },
{headerName: "User Name", field: "username", width: 120 }
];
var gridOptions = {
columnDefs: columnDefs,
enableColResize: true,
rowHeight: 36,
enableSorting: true,
getNodeChildDetails: function(file) {
if (file.children) {
return {
group: true,
children: file.children,
expanded: file.open,
field: 'name',
key: file.name
};
} else {
return null;
}
},
onGridReady: function(params) {
params.api.sizeColumnsToFit();
}
};
this.$.myGrid.setGridOptions(gridOptions);
var eInput = this.$.quickFilterInput;
eInput.addEventListener("input", function () {
var text = eInput.value;
gridOptions.api.setQuickFilter(text);
});
},
detached: function() {
this.$.myGrid.api.destroy();
}
});
</script>
agGrid's grid options has a property for a callback -- onModelUpdated -- that is called when new rows are added to the grid.
attached: function() {
var self = this;
var gridOptions = {
...
onModelUpdated: function(e) {
self._bindGridIconTap();
}
};
}
You could use this event to query the grid for its paper-icon-buttons and add their on-tap attributes as event handlers.
_bindGridIconTap: function() {
this._bindActionsOnGrid('paper-icon-button', 'tap');
},
_bindActionsOnGrid: function(selector, eventName) {
var self = this;
var buttons = this.$.myGrid.querySelectorAll(selector);
buttons.forEach(function(b) {
self._bindEvent(b, eventName);
});
},
_bindEvent: function(el, eventName) {
var self = this;
var methodName = el.getAttribute('on-' + eventName);
var method = self[methodName];
if (method) {
el.addEventListener(eventName, function(e) {
method(e);
e.stopPropagation();
e.preventDefault();
return false;
});
} else {
console.warn(el.localName, 'listener method not found:', methodName);
}
}
plunker
Note you have a bug in:
var args = e.target.getAttribute('data-args').split('~~');
In a tap event for paper-icon-button, e.target is the icon image. You actually want e.currentTarget, which I've done for you in the Plunker.

Unable to format JSON from WCF for HighCharts?

My WCF returns this JSON and i want to bind to HighCharts Pie
Original from WCF -[{"AllRecordsUrl":"http:\/\/EMS\/sites\/IST\/report.aspx","EMSCenterName":"IST","EMSCenterUrl":"http:\/\/EMS\/sites\/IST","Count":2},{"AllRecordsUrl":"http:\/\/EMS\/sites\/LSS\/report.aspx","EMSCenterName":"LSS","EMSCenterUrl":"http:\/\/EMS\/sites\/LSS","Count":17}]
If i hardCode it in cart series as data: [....] it works but the dynamic proccesed data does not..
After processing - [{name: 'IST' , url: 'http://EMS/sites/IST/report.aspx' , y: 2 },{name: 'LSS' , url: 'http://EMS/sites/LSS/report.aspx' , y: 16 }]
Even after processing it to what i showed above highcharts Pie won't work with my data..
I am not sure what is wrong here, would appreciate some guidance
Here's what is done so far ...
function getDataForHub(json) {
var realArray = $.makeArray(json);
//debugger;
//console.log(JSON.stringify(realArray));
var obj = $.parseJSON(JSON.stringify(realArray));
var chartData = [];
$.each(realArray, function (index, item) {
var final;
var element;
var sB = '';
var name = '';
var url = '';
var y = '';
var color = '';
for (element in item) {
if (element == 'EMSCenterName') {
name = 'name' + ": " + "'" + item[element] + "'";
}
if (element == 'AllRecordsUrl') {
url = 'url' + ": " + "'" + item[element] + "'";
}
if (element == 'Count') {
y = 'y' + ": " + item[element];
}
}
sB = name + ' , ' + url + ' , ' + y ;
//console.log(sB);
var elements = [];
//adding each to an array before being pushed to th final array,
elements.push(sB);
chartData.push(elements);
});
return chartData;
}
And here is my Pie
$(function () {
LoadSodByKey("sp.ui.dialog.js", null);
var stdWidth = 530;
var stdHeight = 200;
Highcharts.setOptions({
colors: ['#50B432', '#ED561B', '#DDDF00', '#24CBE5', '#64E572', '#FF9655', '#FFF263', '#6AF9C4']
});
$('#containerpie').highcharts({
chart: {
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: true,
height: stdHeight + 120,
width: stdWidth + stdHeight
},
title: {
text: 'Records per Program'
},
tooltip: {
pointFormat: '{point.name}: <b>{point.percentage:.1f}%</b>'
/*formatter: function () {
return '<b>' + this.point.name;
}*/
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true,
format: '<b>{point.name}</b>: {point.percentage:.1f} %'
},
showInLegend: false
}
},
series: [{
type: 'pie',
size: stdHeight,
data:[{name: 'IST' , url: 'http://EMS/sites/IST/report.aspx' , y: 2 },{name: 'LSS' , url: 'http://EMS/sites/LSS/report.aspx' , y: 16 }],
point: {
events: {
click: function(e) {
//alert(e.point.url);
var options = {
url: e.point.url,
title: e.point.name,
allowMaximize: true,
showClose: true,
width: 1100,
height: 500,
dialogReturnValueCallback: function (result, returnValue) {
//location.reload(true);
}
}
SP.UI.ModalDialog.showModalDialog(options);
e.preventDefault();
}
}
}
}]
});
var data = GetData();});
function GetData(){
var chart = $('#containerpie').highcharts();
series = chart.series[0];
//Ajax call to WCF service
$.ajax({
type: 'GET',
contentType: 'application/json; charset=utf-8',
crossDomain: false,
url: 'http://EMS/_vti_bin/EMSDashboard.svc/GetEMSCenterDataForHub',
data: null,
dataType: 'json',
success: function (response) {
var dynamicData = getDataForHub(response);
//this doesnot work
//series.data = dynamicData;
//even this does not work
//series.data.push(dynamicData)
//Wrong, wrong, wrong
//series.data.push(eval('[' +dynamicData +']'));
//gives me count of two but the chart does not load wiht dynamic data
console.log(series.data.length);
},
error: function (message) {
alert(message.statusText);
}
});
}
Thanx
FIXED:
Here's how
mistake = I had set up a static chart and was trying to use the same with $AJAX call where the chart was already created without the "data" being created, instead now the "data" array is created first and then the chart is created using chart = new Highcharts.Chart({....})
Also removed all client side preprocessing of the JSON received from WCF i.e my server object has additional Properties for Highchart rendering such to get ..
[{"name":"IST","url":"http:\/\/<XXXX>\/sites\/IST\/ASASA.aspx","y":2},
{"name":"LASS","url":"http:\/\/<XXXX>\/sites\/LASS\/ASASA.aspx","y":17}]