Skip to content Skip to sidebar Skip to footer

Google Vis Annotated Timeline From Sql Database Using Php Json Issue

I am trying to create a simple annotated timeline from a PostgreSQL database using a server side PHP script to access the data from the database, then a JavaScript client side scri

Solution 1:

I have experienced this problem before, just fix this line in NON_WORKING_CODE

query.setQuery('SELECT date,level FROM tank1 ORDER BY date');

into

query.setQuery('SELECT *');

This should work. If not, try to fix the preg_quote issue https://code.google.com/p/mc-goog-visualization/issues/detail?id=16

Solution 2:

A look at the Google docmentation page here : http://code.google.com/apis/visualization/documentation/gallery/annotatedtimeline.html Shows the following :

Important: To use this visualization, you must specify the height and width
           of the container element explicitly on your page. So, forexample:
           <divid="chart_div"style="width:400; height:250"></div>.

You don't appear to do this.

EDIT : I just tried the example on that page and indeed if I remove the explicit height and width I get nothing; with the height and width the timeline displays.

Solution 3:

In your response, the keys are not enclosed in quote, it might be the reason why the chart is not rendered

{id:'date', type:'date'}

{"id":"date", "type":"date"}

I just searched for visualization.query documentation and this live example uses a response like yours but in the response, the keys are enclosed in quote:

https://spreadsheets.google.com/tq?key=pCQbetd-CptGXxxQIG7VFIQ&pub=1

I'm not familiarized with PHP and that visualization library you use in vis.php but if you could manage to add those quotes, I'm almost sure that it will work

I'm usign a tabledate with object notation as you did but in .NET and that's the only thing I see difference

Hope it helps, I know is an old post but for people like me in the future

Post a Comment for "Google Vis Annotated Timeline From Sql Database Using Php Json Issue"