Dear Mr/Mrs
I have a question about the Implemation of the API for PieCharts. I am developing a website that needs to show a PieChart. For the moment I'm experimenting with the API but got stuck on one particular piece of code. When I insert the data with the preload tag everything works just fine. when I use my own url it doesn't work.
If I use a local url I get this errormessage:"Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource."
If I use my server url I get this errormessage:"No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access."
This is my code:
<script src="lib/zoomcharts.js"></script>
<div id='demo' style='width:100%; height:300px;'></div>
var chart = new PieChart({
container:document.getElementById("demo"),
area: { height: 350},
data: { url: "json/data.json"},
labels: {enabled: false},
legend: {
enabled: true,
width:900,
panel:{
side:"top",
align:"center"
}
}
};
I copied a json implementation from your API:
{
subvalues: [
{
id: "foo", value: 100, subvalues: [
{ id: "foo-1", value: 50, style: { expandable: false } },
{ id: "foo-2", value: 50, style: { expandable: false } }
]
},
{ id: "bar", value: 50, style: { expandable: false } },
{ id: "baz", value: 30, style: { expandable: false } }
]
}
Do you know what I am doing wrong? Or something I just missed?