Hi Gianluca,

There were a couple problems with your data structure, and also very
importantly, you needed to change from loading jsapi to loading the
gstatic.com/charts/loader.js  Here is your example working:
https://jsfiddle.net/dlaliberte/Lxhyg4tw/

Also, it is generally not a good idea to use Dates in that format because
different browsers may have problems parsing the date strings in the same
way.  See https://developers.google.com/chart/interactive/docs/datesandtimes

On Sat, Jan 23, 2016 at 3:57 AM, Gianluca Albanese <[email protected]>
wrote:

> hi all,
>
> ERROR:
> .Uncaught SyntaxError: Unexpected token {
>
> this is my code
>
> <html>
>   <head>
>    <script type="text/javascript" src="http://www.google.com/jsapi
> "></script>
>
>     <script type="text/javascript">
>       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({ 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('01/01/2015')},{v: new
> Date('12/31/2015')}]},
> {c:[{v:'2'},{v:'George'},{v: new Date('01/01/2016')},{v: new
> Date('12/31/2016')}]},
> {c:[{v:'3'},{v:'Anthony'},{v: new Date('01/01/2017')},{v: new
> Date('12/31/2017')}]
> }]
> });
>
>         chart.draw(dataTable);
>       }
>     </script>
>   </head>
>   <body>
>     <div id="timeline" style="height:300px;"></div>
>   </body>
> </html>
>
> i cant find the error, can someone plz help me?
>
> 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/cbfa526b-ab00-4176-9297-772aec6dc6c7%40googlegroups.com
> <https://groups.google.com/d/msgid/google-visualization-api/cbfa526b-ab00-4176-9297-772aec6dc6c7%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2>
[email protected] <[email protected]>   5CC, Cambridge MA

-- 
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/CAOtcSJN0A6H_Xf2%2BT1gsr%3Dt3eMxMKKhZxOAVPsJ4dn2Q_-9wQg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to