I found the misstake:
I use type datetime, so I can't use date(1361310226000)
Dam.
Thanks for your helping.

Am Montag, 11. November 2013 15:00:53 UTC+1 schrieb Markus Schlick:
>
> They don't accept type datetime or date.
> If I set type string, it will show the table.
>
> Now I set back to annotatedtimeline and it will not redraw the timeline.
>
> Am Montag, 11. November 2013 02:34:48 UTC+1 schrieb asgallant:
>>
>> Adding columns when they are not needed is only going to cause more 
>> problems.  I'd like you to try replacing the AnnotatedTimeline chart with a 
>> Table visualization, just to see if there is a problem with the data or the 
>> visualization.  Replace this line:
>>
>> var annotatedtimeline = new 
>> google.visualization.AnnotatedTimeLine(document.getElementById('visualization'));
>>
>> with this:
>>
>> var annotatedtimeline = new 
>> google.visualization.Table(document.getElementById('visualization'));
>>
>> and this line:
>>
>> google.load('visualization', '1', {packages: ['annotatedtimeline'], 
>> callback: drawVisualization});
>>
>> with this:
>>
>> google.load('visualization', '1', {packages: ['table'], callback: 
>> drawVisualization});
>>
>> You can switch them back after testing.  If the AJAX code is working 
>> properly, then you should see the table update.
>>
>> On Sunday, November 10, 2013 1:22:54 PM UTC-5, Markus Schlick wrote:
>>>
>>> Thanks for your helpful response.
>>> I copied <http://www.dict.cc/englisch-deutsch/copied.html> your code, 
>>> but javascript doesn't execute the code after
>>>
>>>> success:  function(html){
>>>>
>>>> data = new google.visualization.DataTable(html.table);
>>>>
>>>>      alert('test');
>>>
>>>  so
>>>
>>>> annotatedtimeline.draw(data, options);
>>>>
>>> will not execute (test will displayed).
>>> So the Draw will not be change.
>>> I can see this, when I insert a alert after the draw Code. There is no 
>>> Javascript error.
>>>
>>> When I set:
>>>
>>>> success:  function(html){
>>>>
>>>> data = new google.visualization.DataTable(html.table);
>>>>
>>>> data.addColumn('datetime', 'Datum');
>>>>
>>>>    data.addColumn('number', 'Leistung');
>>>>>
>>>>> annotatedtimeline.draw(data, options);
>>>>
>>>> },
>>>>
>>>> It shows  "no data available" again.
>>>
>>> Am Sonntag, 10. November 2013 11:27:42 UTC+1 schrieb Markus Schlick:
>>>>
>>>> Hello,
>>>> I have a problem with the reload of Annotated Time via AJAX
>>>> Here is my Code:
>>>>
>>>>> <!DOCTYPE html>
>>>>> <html>
>>>>>   <head>
>>>>>     <meta charset="UTF-8" />
>>>>>     <title>seiteTitle</title>
>>>>>     <base href="http://localhost/";>
>>>>>     <meta name="viewport" content="width=device-width, initial-scale=1.0">
>>>>>     <!-- Latest compiled and minified CSS -->
>>>>>   <link rel="stylesheet" 
>>>>> href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css";>
>>>>>   <!-- Optional theme -->
>>>>>   <link rel="stylesheet" 
>>>>> href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css";>
>>>>>             <script src="http://code.jquery.com/jquery.min.js";></script>
>>>>>   <script 
>>>>> src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js";></script>
>>>>>   </head>
>>>>>   <body>
>>>>>   <link 
>>>>> href="http://www.eyecon.ro/bootstrap-datepicker/css/datepicker.css"; 
>>>>> rel="stylesheet">
>>>>>     <script 
>>>>> src="http://www.eyecon.ro/bootstrap-datepicker/js/bootstrap-datepicker.js";></script>
>>>>>   <script>
>>>>>           $(function(){
>>>>>                   window.prettyPrint && prettyPrint();
>>>>>                   $('#dp2').datepicker()
>>>>>                   .on('changeDate', function(ev){
>>>>>                                   $.ajax({
>>>>>                                           type: "GET",
>>>>>                                           url: 
>>>>> "visualization/leistung/jahr/" + ev.date.valueOf() + "/ajax",
>>>>>                                                   dataType: "json",
>>>>>                                           success:  function(html){
>>>>>                                                           var data = new 
>>>>> google.visualization.DataTable(html);
>>>>>       data.addColumn('datetime', 'Datum');
>>>>>       data.addColumn('number', 'Leistung');
>>>>>                                                           var 
>>>>> annotatedtimeline = new 
>>>>> google.visualization.AnnotatedTimeLine(document.getElementById('visualization'));
>>>>>                                                     
>>>>> annotatedtimeline.draw(data, {'displayAnnotations': true, 'allowRedraw': 
>>>>> true});
>>>>>                                                   
>>>>>                                           },
>>>>>   error: function(jqXHR,error, errorThrown) {  
>>>>>                if(jqXHR.status&&jqXHR.status==200){
>>>>>                     alert(jqXHR.responseText); 
>>>>>                }else{
>>>>>                    alert("Something went wrong");
>>>>>                }
>>>>>           }
>>>>>                                   });
>>>>>                   });
>>>>>           });
>>>>>   </script>
>>>>>     
>>>>> <nav class="navbar navbar-default" role="navigation">
>>>>>   <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
>>>>>     <ul class="nav navbar-nav">
>>>>>       <li><input type="text" class="span2" value="2013-11-09" 
>>>>> data-date-format="yyyy-mm-dd" id="dp2" style="margin: 7px 0 0 7px;"></li>
>>>>>     </ul>
>>>>>   </div>
>>>>> </nav>
>>>>> <script type="text/javascript" src="http://www.google.com/jsapi";></script>
>>>>>   <script type="text/javascript">
>>>>>     google.load('visualization', '1', {packages: ['annotatedtimeline']});
>>>>>     function drawVisualization() {
>>>>>       var data = new google.visualization.DataTable();
>>>>>       data.addColumn('datetime', 'Datum');
>>>>>       data.addColumn('number', 'Leistung');
>>>>>       data.addRows([
>>>>>                   [new Date(1361310226000), 24]
>>>>>           ,        [new Date(1361401138000), 18]
>>>>>           ,        [new Date(1361487506000), 9]
>>>>>           ,        [new Date(1361532551000), 13]
>>>>>           ,        [new Date(1363087016000), 276]
>>>>>                 ]);
>>>>>     
>>>>>       var annotatedtimeline = new google.visualization.AnnotatedTimeLine(
>>>>>           document.getElementById('visualization'));
>>>>>       annotatedtimeline.draw(data, {'displayAnnotations': true, 
>>>>> 'allowRedraw': true});
>>>>>     }
>>>>>     
>>>>>     google.setOnLoadCallback(drawVisualization);
>>>>>   </script>
>>>>>   <div id="visualization" style="width: 800px; height: 400px;"></div>
>>>>>   </body>
>>>>>   </html>
>>>>>
>>>>>
>>>> This will call 
>>>> http://localhost/visualization/leistung/jahr/1383692400000/ajax on 
>>>> change the date.
>>>> The following is the return to jquery:
>>>>
>>>>> {"version":0.6,"reqId":0,"status":"ok","sig":2147483647,"table":{"cols":[{"id":"A","label":"Datum","pattern":"","type":"datetime"},{"id":"B","label":"Leistung","pattern":"","type":"number"}],"rows":[{"c":[{"v":"date(1361310226000)","f":null},{"v":24,"f":null}]},{"c":[{"v":"date(1361401138000)","f":null},{"v":18,"f":null}]},{"c":[{"v":"date(1361487506000)","f":null},{"v":9,"f":null}]},{"c":[{"v":"date(1361532551000)","f":null},{"v":13,"f":null}]},{"c":[{"v":"date(1363087016000)","f":null},{"v":276,"f":null}]}]}}
>>>>>
>>>>>
>>>> So it have to Draw the same Time Line as on the first request of the 
>>>> page.4
>>>> But it shows "no data available" on the Time Line, with no error on 
>>>> FireBug.
>>>>
>>>> Did annybody see the misstake?
>>>> Thanks a lot.
>>>>
>>>

-- 
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 http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to