I am using Amcharts to create column charts which rotate and become horizontal bar charts. I am using dataLoader
plugin of Amcharts to connect to a php file which is connecting to mysql and retreiving data and the php file is outputting data as JSON
Issue I am facing is that if the php file is in the same folder as the file containing the html, the chart loads properly
,
"dataLoader": {
"url": "data.php"
},
But if I put the php file in a include folder, chart does not load and it gives a blank screen.
,
"dataLoader": {
"url": "http://MyWebsite.com/include/data.php"
},
I checked the php json file both in the root and in the include folder and both are properly outputting valid JSON
I do not want to use Jquery and I am new to javascript. Please tell what I am doing wrong.
Update -
This loading error is coming on and off. This is the error coming in the browser console - Failed to load http://MyWebsite.com/include/data.php: No 'Access-Control-Allow-Origin' header is present on the requested resource.Origin 'http://www.MyWebsite.com is therefore not allowed access