I am trying to create a column chart from JSON data in Asp.Net MVC, I have a an ajax call getting JSON object returned from a controller that looks like this
[{"FiscalPeriod":"01","FullTimeEmployeeNeeded":0,"Employees":6320,"Contractors":2685},{"FiscalPeriod":"02","FullTimeEmployeeNeeded":0,"Employees":12504,"Contractors":0},{"FiscalPeriod":"03","FullTimeEmployeeNeeded":415,"Employees":19894,"Contractors":7035},{"FiscalPeriod":"04","FullTimeEmployeeNeeded":1639,"Employees":25942,"Contractors":9864},{"FiscalPeriod":"05","FullTimeEmployeeNeeded":2689,"Employees":30542,"Contractors":10697},{"FiscalPeriod":"06","FullTimeEmployeeNeeded":3897,"Employees":36102,"Contractors":11697},{"FiscalPeriod":"07","FullTimeEmployeeNeeded":4857,"Employees":39150,"Contractors":12377},{"FiscalPeriod":"08","FullTimeEmployeeNeeded":5817,"Employees":42110,"Contractors":13017},{"FiscalPeriod":"09","FullTimeEmployeeNeeded":7017,"Employees":49690,"Contractors":13639},{"FiscalPeriod":"10","FullTimeEmployeeNeeded":7977,"Employees":55754,"Contractors":13943},{"FiscalPeriod":"11","FullTimeEmployeeNeeded":8937,"Employees":58410,"Contractors":14063},{"FiscalPeriod":"12","FullTimeEmployeeNeeded":9186,"Employees":65990,"Contractors":14063}]
My code that creates the graph is
function createGraph(object) { $("#chart").igDataChart({ dataSouce: object, title: "Cumulative Data", height: "550px", width: "98%", legend: { element: "legend" }, axes: [{ name: "xAxis", type: "categoryX", label: "FiscalPeriod", title: "FiscalPeriod" }, { name: "yAxis", type: "numericY", title: "Hours", minimumValue: 0 } ], series: [ { name: "series1", title: "Employees", xAxis: "xAxis", yAxis: "yAxis", valueMemberPath: "Employees", type: "column" } ,{ name: "series2", title: "Contractors", valueMemberPath: "Contractors", xAxis: "xAxis", yAxis: "yAxis", type: "column" }, { name: "series3", title: "Full Time Employee Needed", valueMemberPath: "FullTimeEmployeeNeeded", xAxis: "xAxis", yAxis: "yAxis", type: "column" }] , horizontalZoomable: true, verticalZoomable: true, windowResponse: "immediate" }); }
The issue is that it does not display any of the columns, x and y axis labels. It does display the proper names in the legend, but that is the only thing it displays correctly
Wow, can't believe I missed that. Thanks
Hello ,
I'm just following up to see if you need any further assistance with this issue. If so please let me know.
Hello Steven,
Thank you for contacting Infragistics Developer Support!
There is a typo in your source code. "dataSouce" should be dataSource.
Steven Ackley said: I am trying to create a column chart from JSON data in Asp.Net MVC, I have a an ajax call getting JSON object returned from a controller that looks like this $("#chart").igDataChart({ dataSouce: object, . . . }); }
$("#chart").igDataChart({ dataSouce: object,
. .
. }); }
Please let me know if I may be of further assistance.