I am creating amcharts graph on ASP.net website. I have hosted a josn file in my localhost and IIS server is running. but graph always display as "Loading data..."
here my Javascript function.
AmCharts.ready(function () {
var chart = new AmCharts.AmSerialChart();
chart.dataLoader = {
url: "http://localhost:1080/JSON/emp_info.json",
postProcess: function (data, options) {
if (data === null) {
data = [];
options.chart.addLabel("50%", "50%", "No Data Available");
}
return data;
}
};
chart.categoryField = "employee_no";
var graph = new AmCharts.AmGraph();
graph.valueField = "Salary";
graph.type = "line";
graph.bullet = "round";
graph.lineColor = "#8d1cc6";
chart.addGraph(graph);
chart.write('chartdiv');
});
Google chrome gives following error.
XMLHttpRequest cannot load http://localhost:1080/JSON/emp_info.json. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:59062' is therefore not allowed access.
How can I solve this issue ?