hi Daniel,
thanks for your answer with which I was able to fix the error.
For now I have another problem to solve.
I tried to upload the data via ajax to generate the graph, but I get the 
following error

ERROR
Uncaught Error: Invalid JSON string: { 
cols:[{id:'Fase',label:'Fase',type:'string'},{id:'Responsabile',label:'Responsabile',type:'string'},{id:'Inizio',label:'Inizio',type:'date'},{id:'Fine',label:'Fine',type:'date'}],
 
rows:[{c:[{v:'1'},{v:'Philip'},{v: new Date(2015,01,01)},{v: new 
Date(2015,12,31)}]},{c:[{v:'2'},{v:'George'},{v: new Date(2016,01,01))},{v: 
new Date(2016,12,31)}]},{c:[{v:'3'},{v:'Anthony'},{v: new 
Date(2017,01,01))},{v: new Date(2017,12,31)}]}]}

this my code
<html>
  <head>
<script type="text/javascript" src="loader.js"></script>
<script type="text/javascript" src="jquery-1.12.0.min.js"></script>
<script type="text/javascript">
var result = $.ajax("http://localhost/gantt_json.asp";, {
  async: false,
  data: {fk_obbiettivo: '25'},
}).responseText;
console.log(result);


google.charts.load('current', {
   'packages': ['timeline']
 });
 google.charts.setOnLoadCallback(drawChart);

 function drawChart() {
   var container = document.getElementById('timeline');
   var chart = new google.visualization.Timeline(container);
   var dataTable = new google.visualization.DataTable(result);

   chart.draw(dataTable);
 }
 </script>
  </head>
  <body>
    <div id="timeline" style="height:300px;"></div>
  </body>
</html>

I think the error is due to the string generated from the page 
gantt_json.asp but I can not figure out where I'm wrong.
This is the code of the page gantt_json.asp


<%
    Response.ContentType = "application/json"
'colonne
Response.Write("{ cols:[")
    Response.Write("{id:'Fase',label:'Fase',type:'string'},")
Response.Write("{id:'Responsabile',label:'Responsabile',type:'string'},")
Response.Write("{id:'Inizio',label:'Inizio',type:'date'},")
Response.Write("{id:'Fine',label:'Fine',type:'date'}],")
'righe
Response.Write(" rows:[")
Response.Write("{c:[{v:'1'},{v:'Philip'},{v: new Date(2015,01,01)},{v: new 
Date(2015,12,31)}]},")
Response.Write("{c:[{v:'2'},{v:'George'},{v: new Date(2016,01,01))},{v: new 
Date(2016,12,31)}]},")
Response.Write("{c:[{v:'3'},{v:'Anthony'},{v: new Date(2017,01,01))},{v: 
new Date(2017,12,31)}]}")
Response.Write("]}")
%>

I hope you can help me again and I thank you in advance.
Gianluca

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/bc22a8cc-c87b-4ab4-aa72-3897d9f9763d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to