this is the JSON output from PHP file I am getting the data in this format 
which is fine

"[new Date(2012,04-1,19,12,27, 00),182,],[new Date(2012,04-1,19,12,28, 
00),183,],"



$output = '';
$rows = mysql_num_rows($scans);
$row = mysql_fetch_row($scans); //skip first row as it is incomplete
      while($rows>2)//skip last row as it is incomplete
      {
            $row = mysql_fetch_row($scans);
            $output = $output."[new Date(".$row[0].", 00),".$row[1].",],";
            $rows--; 
      }

echo json_encode($output);

On Thursday, 19 April 2012 13:23:19 UTC-4, asgallant wrote:
>
> The PHP code will have to be customized for your particular needs.  If you 
> don't use PDO's, you'll have to change it to whichever method you do use. 
>  You can check the output by calling the php script from your browser - the 
> JSON should look something like the json shown at the bottom of this page: 
> https://developers.google.com/chart/interactive/docs/php_example (although 
> it will have all whitespace removed).  Once you get the JSON right, we can 
> work on getting your charts updated.
>
> On Thursday, April 19, 2012 12:53:49 PM UTC-4, Xtremer wrote:
>>
>> Thanks for your help, but I am still not able to figure out how to 
>> implement this. I tried using the code but no success. 
>>
>>
>> On Thursday, 19 April 2012 12:25:32 UTC-4, asgallant wrote:
>>>
>>> Ok, move the PHP code that generates your data to another page, and use 
>>> AJAX to fetch the data from that script.  This will allow you to refresh 
>>> the chart data without reloading the page.  I find jQuery's AJAX functions 
>>> particularly helpful for this: http://api.jquery.com/category/ajax/ 
>>>
>>> Your code might look something like this: 
>>> https://groups.google.com/d/msg/google-visualization-api/XS4xaEgkRtw/ClBcYNMDkt4J
>>>
>>> To make that work, you need to put the data into a json format the 
>>> charts can understand.  PHP's json_encode() function can help you with 
>>> this.  Here's an example script: 
>>> https://groups.google.com/d/msg/google-visualization-api/Gy18YdVSSfQ/tKdtzSfqKlcJ
>>>
>>> On Thursday, April 19, 2012 12:12:05 PM UTC-4, Xtremer wrote:
>>>>
>>>> No I am using php/mysql to retrieve data then I am just feeding that 
>>>> data into charts and refreshing this whole page every minute, what I 
>>>> actually want is to refresh just the graph every minute not the whole page.
>>>>
>>>> On Thursday, 19 April 2012 12:10:14 UTC-4, asgallant wrote:
>>>>>
>>>>> Do you use the visualization Query API for retrieving your charts' 
>>>>> data?
>>>>>
>>>>> On Thursday, April 19, 2012 12:00:15 PM UTC-4, Xtremer wrote:
>>>>>>
>>>>>>
>>>>>> Hi 
>>>>>> I need help in auto refreshing the annotated time line chart. I 
>>>>>> created the chart by populating data from DB using php/mysql, I want to 
>>>>>> ad 
>>>>>> the functionality of auto refresh data without having to refresh the 
>>>>>> whole 
>>>>>> page. I tried searching a lot on google but could not get a solution. 
>>>>>> Would 
>>>>>> appreciate your help as your post say that you already have this refresh 
>>>>>> feature working.
>>>>>>
>>>>>> Help please.
>>>>>>
>>>>>> On Monday, 22 September 2008 17:31:22 UTC-4, Aerodyno wrote:
>>>>>>>
>>>>>>> The annotated timeline chart is great, but the whole chart redraws 
>>>>>>> and 
>>>>>>> blinks/flashes even when I add just a single point to the data.table 
>>>>>>> and call refresh.  This creates an annoying user experience. 
>>>>>>>
>>>>>>> Is there any way to just update a single point in the chart -- 
>>>>>>> without 
>>>>>>> the massive redraw?  Am I missing something (should I be using some 
>>>>>>> data api) or do we need to wait for google to release the feature? 
>>>>>>>
>>>>>>> Thanks in advance! I love writing code using Google's API's. 
>>>>>>>
>>>>>>> - Savraj 
>>>>>>>
>>>>>>
>>>>>> On Monday, 22 September 2008 17:31:22 UTC-4, Aerodyno wrote:
>>>>>>>
>>>>>>> The annotated timeline chart is great, but the whole chart redraws 
>>>>>>> and 
>>>>>>> blinks/flashes even when I add just a single point to the data.table 
>>>>>>> and call refresh.  This creates an annoying user experience. 
>>>>>>>
>>>>>>> Is there any way to just update a single point in the chart -- 
>>>>>>> without 
>>>>>>> the massive redraw?  Am I missing something (should I be using some 
>>>>>>> data api) or do we need to wait for google to release the feature? 
>>>>>>>
>>>>>>> Thanks in advance! I love writing code using Google's API's. 
>>>>>>>
>>>>>>> - Savraj 
>>>>>>>
>>>>>>
>>>>>> On Monday, 22 September 2008 17:31:22 UTC-4, Aerodyno wrote:
>>>>>>>
>>>>>>> The annotated timeline chart is great, but the whole chart redraws 
>>>>>>> and 
>>>>>>> blinks/flashes even when I add just a single point to the data.table 
>>>>>>> and call refresh.  This creates an annoying user experience. 
>>>>>>>
>>>>>>> Is there any way to just update a single point in the chart -- 
>>>>>>> without 
>>>>>>> the massive redraw?  Am I missing something (should I be using some 
>>>>>>> data api) or do we need to wait for google to release the feature? 
>>>>>>>
>>>>>>> Thanks in advance! I love writing code using Google's API's. 
>>>>>>>
>>>>>>> - Savraj 
>>>>>>>
>>>>>>
>>>>>> On Monday, 22 September 2008 17:31:22 UTC-4, Aerodyno wrote:
>>>>>>>
>>>>>>> The annotated timeline chart is great, but the whole chart redraws 
>>>>>>> and 
>>>>>>> blinks/flashes even when I add just a single point to the data.table 
>>>>>>> and call refresh.  This creates an annoying user experience. 
>>>>>>>
>>>>>>> Is there any way to just update a single point in the chart -- 
>>>>>>> without 
>>>>>>> the massive redraw?  Am I missing something (should I be using some 
>>>>>>> data api) or do we need to wait for google to release the feature? 
>>>>>>>
>>>>>>> Thanks in advance! I love writing code using Google's API's. 
>>>>>>>
>>>>>>> - Savraj 
>>>>>>>
>>>>>>
>>>>>> On Monday, 22 September 2008 17:31:22 UTC-4, Aerodyno wrote:
>>>>>>>
>>>>>>> The annotated timeline chart is great, but the whole chart redraws 
>>>>>>> and 
>>>>>>> blinks/flashes even when I add just a single point to the data.table 
>>>>>>> and call refresh.  This creates an annoying user experience. 
>>>>>>>
>>>>>>> Is there any way to just update a single point in the chart -- 
>>>>>>> without 
>>>>>>> the massive redraw?  Am I missing something (should I be using some 
>>>>>>> data api) or do we need to wait for google to release the feature? 
>>>>>>>
>>>>>>> Thanks in advance! I love writing code using Google's API's. 
>>>>>>>
>>>>>>> - Savraj 
>>>>>>>
>>>>>>
>>>>>> On Monday, 22 September 2008 17:31:22 UTC-4, Aerodyno wrote:
>>>>>>>
>>>>>>> The annotated timeline chart is great, but the whole chart redraws 
>>>>>>> and 
>>>>>>> blinks/flashes even when I add just a single point to the data.table 
>>>>>>> and call refresh.  This creates an annoying user experience. 
>>>>>>>
>>>>>>> Is there any way to just update a single point in the chart -- 
>>>>>>> without 
>>>>>>> the massive redraw?  Am I missing something (should I be using some 
>>>>>>> data api) or do we need to wait for google to release the feature? 
>>>>>>>
>>>>>>> Thanks in advance! I love writing code using Google's API's. 
>>>>>>>
>>>>>>> - Savraj 
>>>>>>>
>>>>>>
>>>>>> On Monday, 22 September 2008 17:31:22 UTC-4, Aerodyno wrote:
>>>>>>>
>>>>>>> The annotated timeline chart is great, but the whole chart redraws 
>>>>>>> and 
>>>>>>> blinks/flashes even when I add just a single point to the data.table 
>>>>>>> and call refresh.  This creates an annoying user experience. 
>>>>>>>
>>>>>>> Is there any way to just update a single point in the chart -- 
>>>>>>> without 
>>>>>>> the massive redraw?  Am I missing something (should I be using some 
>>>>>>> data api) or do we need to wait for google to release the feature? 
>>>>>>>
>>>>>>> Thanks in advance! I love writing code using Google's API's. 
>>>>>>>
>>>>>>> - Savraj 
>>>>>>>
>>>>>>
>>>>>> On Monday, 22 September 2008 17:31:22 UTC-4, Aerodyno wrote:
>>>>>>>
>>>>>>> The annotated timeline chart is great, but the whole chart redraws 
>>>>>>> and 
>>>>>>> blinks/flashes even when I add just a single point to the data.table 
>>>>>>> and call refresh.  This creates an annoying user experience. 
>>>>>>>
>>>>>>> Is there any way to just update a single point in the chart -- 
>>>>>>> without 
>>>>>>> the massive redraw?  Am I missing something (should I be using some 
>>>>>>> data api) or do we need to wait for google to release the feature? 
>>>>>>>
>>>>>>> Thanks in advance! I love writing code using Google's API's. 
>>>>>>>
>>>>>>> - Savraj 
>>>>>>>
>>>>>>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-visualization-api/-/PxXrktNfpPsJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en.

Reply via email to