Hello
I am a beginner. I try first with very simple application:
That works (clear as in the example):
<script src="lib/zoomcharts.js"></script>
<noscript><strong>JavaScript is currently disabled in your browser. Make sure you allowed the scripting after opening this page.</strong></noscript>
<div id="demo"></div>
<script>
var t = new TimeChart({
container: document.getElementById("demo"),
data:{
preloaded: {
values: [
[0, 100],
[10, 200],
[20, 300],
[30, 400],
[40, 500]
],
unit: 's'
},
timestampInSeconds: true
}
});
</script>
But when I want to read the data from a URL, it does not work:
<script src="lib/zoomcharts.js"></script>
<noscript><strong>JavaScript is currently disabled in your browser. Make sure you allowed the scripting after opening this page.</strong></noscript>
<div id="demo"></div>
<script>
var t = new TimeChart({
container: document.getElementById("demo"),
data:
{
units:["h"],
url: "data_3.json"
}
});
</script>
I suspect the problem is the JSON file (data_3.json):
{
"unit":"s",
"data":[[0, 100],[10, 200],[20, 300],[40, 500]],
"from":0,
"to": 40
}
Where is the problem? Can anyone provide an example of a JSON file to me? Thank you all.