Hi,
I am trying (again) loading Netcharts Data from an Oracle Stored procedures that returns the JSON data structure.
If I use the Stored Procedure URL in my browser, it works perfectly and I can see in the browser the following data structure:
{
"nodes":[
{"id":"n1", "loaded":true, "style":{ "fillColor": "rgba(236,46,46,0.8)", "label":"Node1"}},
{"id":"n2", "loaded":true, "style":{ "fillColor": "rgba(47,195,47,0.8)", "label":"Node2"}},
{"id":"n3", "loaded":true, "style":{ "fillColor": "rgba(28,124,213,0.8)", "label":"Node3"}}
],
"links":[
{"id":"l1","from":"n1", "to":"n2", "style":{"fillColor":"rgba(236,46,46,1)", "toDecoration":"arrow"}},
{"id":"l2","from":"n2", "to":"n3", "style":{"fillColor":"rgba(47,195,47,1)", "toDecoration":"arrow"}},
{"id":"l3","from":"n3", "to":"n1", "style":{"fillColor":"rgba(28,124,213,1)", "toDecoration":"arrow"}}
]
}
This is the code from my test page:
<!DOCTYPE html>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="reset.css" type="text/css" />
<link rel="stylesheet" href="main.css" type="text/css" />
<title>NetChart Example</title>
</head>
<body>
<div>
<script src="https://cdn.zoomcharts-cloud.com/1/latest/zoomcharts.js" type="text/javascript"></script>
<div id="demo"></div>
<script>
var t = new NetChart({
container: document.getElementById("demo"),
area: { height: 350 },
data: { url: "http://myserver.com/pls/portal/pms.onlinepack.testjson" }
});
</script>
</div>
</body>
</html>
If I load the same data from a file. It works fine.
If I load the data form the Stored Procedure "http://myserver.com/pls/portal/pms.onlinepack.testjson" I have the following error in the trace of the Browser:
The http request from Netcharts Script is not working.
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://myserver.com/pls/portal/pms.onlinepack.testjson?nodes=. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
Help is welcome!
Thanks,
Paulo.